mirror of https://github.com/hak5/openwrt-owl.git
parent
f4daa84832
commit
7bc5a672c1
|
@ -34,11 +34,8 @@ static void ap91_eth_set_port_name(unsigned port, const char *name)
|
|||
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;
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
#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 */
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#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[] = {
|
||||
{
|
||||
|
@ -490,10 +490,7 @@ void __init ar71xx_add_device_eth(unsigned int id)
|
|||
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",
|
||||
|
@ -580,3 +577,24 @@ static int __init ar71xx_kmac_setup(char *str)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -20,8 +20,10 @@ void ar71xx_add_device_spi(struct ar71xx_spi_platform_data *pdata,
|
|||
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;
|
||||
|
|
|
@ -109,14 +109,15 @@ static void __init ap81_setup(void)
|
|||
{
|
||||
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;
|
||||
|
||||
|
|
|
@ -196,15 +196,15 @@ static void __init ap83_generic_setup(void)
|
|||
{
|
||||
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;
|
||||
|
|
|
@ -118,8 +118,11 @@ static void __init dir_600_a1_setup(void)
|
|||
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);
|
||||
|
||||
|
@ -130,7 +133,7 @@ static void __init dir_600_a1_setup(void)
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,8 @@ static void __init dir_615c1_setup(void)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -145,22 +145,18 @@ static struct platform_device dir825b1_rtl8366s_device = {
|
|||
|
||||
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;
|
||||
|
|
|
@ -145,8 +145,11 @@ static struct gpio_button eap7660d_gpio_buttons[] __initdata = {
|
|||
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);
|
||||
|
|
|
@ -133,15 +133,15 @@ static void __init mzk_w04nu_setup(void)
|
|||
{
|
||||
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;
|
||||
|
||||
|
|
|
@ -128,15 +128,15 @@ static void __init mzk_w300nh_setup(void)
|
|||
{
|
||||
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;
|
||||
|
||||
|
|
|
@ -184,15 +184,15 @@ static void __init nbg460n_setup(void)
|
|||
/* 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;
|
||||
|
|
|
@ -51,9 +51,11 @@ static void __init pb42_init(void)
|
|||
|
||||
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;
|
||||
|
|
|
@ -173,11 +173,13 @@ static void __init pb44_init(void)
|
|||
{
|
||||
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;
|
||||
|
|
|
@ -84,14 +84,15 @@ static void __init pb92_init(void)
|
|||
{
|
||||
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;
|
||||
|
|
|
@ -179,6 +179,7 @@ static void __init rb411_setup(void)
|
|||
|
||||
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;
|
||||
|
||||
|
@ -210,9 +211,11 @@ static void __init rb433_setup(void)
|
|||
|
||||
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;
|
||||
|
||||
|
@ -245,9 +248,11 @@ static void __init rb450_generic_setup(int gige)
|
|||
|
||||
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;
|
||||
|
||||
|
@ -278,10 +283,12 @@ static void __init rb493_setup(void)
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#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[] = {
|
||||
|
@ -124,7 +125,10 @@ static void __init rb750_setup(void)
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -118,7 +118,8 @@ static void __init tew_632brp_setup(void)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,13 +110,12 @@ static void __init tl_wa901nd_setup(void)
|
|||
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;
|
||||
|
|
|
@ -126,8 +126,7 @@ static void __init tl_wr1043nd_setup(void)
|
|||
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;
|
||||
|
|
|
@ -109,7 +109,8 @@ static void __init tl_wr741nd_setup(void)
|
|||
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;
|
||||
|
|
|
@ -115,10 +115,9 @@ static void __init tl_wr841n_v1_setup(void)
|
|||
{
|
||||
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;
|
||||
|
|
|
@ -116,10 +116,9 @@ static void __init tl_wr941nd_setup(void)
|
|||
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;
|
||||
|
|
|
@ -142,9 +142,11 @@ static void __init ubnt_rs_setup(void)
|
|||
|
||||
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;
|
||||
|
@ -170,9 +172,11 @@ static void __init ubnt_rspro_setup(void)
|
|||
|
||||
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;
|
||||
|
@ -205,6 +209,7 @@ static void __init ubnt_lssr71_setup(void)
|
|||
|
||||
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;
|
||||
|
||||
|
@ -222,12 +227,12 @@ static void __init ubnt_m_setup(void)
|
|||
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;
|
||||
|
|
|
@ -168,14 +168,14 @@ static void __init wndr3700_setup(void)
|
|||
{
|
||||
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;
|
||||
|
|
|
@ -118,14 +118,15 @@ static void __init wnr2000_setup(void)
|
|||
{
|
||||
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;
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ static void __init wp543_setup(void)
|
|||
|
||||
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 |
|
||||
|
|
|
@ -121,8 +121,10 @@ static void __init wrt160nl_setup(void)
|
|||
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);
|
||||
|
||||
|
|
|
@ -131,21 +131,16 @@ static struct gpio_button wrt400n_gpio_buttons[] __initdata = {
|
|||
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;
|
||||
|
||||
|
|
|
@ -228,15 +228,16 @@ static struct platform_device wzrhpg300nh_rtl8366s_device = {
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue