Commit 1e2c8d83 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

ar7: add fixed PHY support for the two on-board cpmac

This patch adds fixed PHY support for the two on-chip
cpmac Ethernet adapters.
Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d76c626b
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/phy.h>
#include <linux/phy_fixed.h>
#include <asm/addrspace.h> #include <asm/addrspace.h>
#include <asm/mach-ar7/ar7.h> #include <asm/mach-ar7/ar7.h>
...@@ -209,6 +211,12 @@ static struct physmap_flash_data physmap_flash_data = { ...@@ -209,6 +211,12 @@ static struct physmap_flash_data physmap_flash_data = {
.width = 2, .width = 2,
}; };
static struct fixed_phy_status fixed_phy_status __initdata = {
.link = 1,
.speed = 100,
.duplex = 1,
};
static struct plat_cpmac_data cpmac_low_data = { static struct plat_cpmac_data cpmac_low_data = {
.reset_bit = 17, .reset_bit = 17,
.power_bit = 20, .power_bit = 20,
...@@ -530,6 +538,9 @@ static int __init ar7_register_devices(void) ...@@ -530,6 +538,9 @@ static int __init ar7_register_devices(void)
} }
if (ar7_has_high_cpmac()) { if (ar7_has_high_cpmac()) {
res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status);
if (res && res != -ENODEV)
return res;
cpmac_get_mac(1, cpmac_high_data.dev_addr); cpmac_get_mac(1, cpmac_high_data.dev_addr);
res = platform_device_register(&cpmac_high); res = platform_device_register(&cpmac_high);
if (res) if (res)
...@@ -538,6 +549,10 @@ static int __init ar7_register_devices(void) ...@@ -538,6 +549,10 @@ static int __init ar7_register_devices(void)
cpmac_low_data.phy_mask = 0xffffffff; cpmac_low_data.phy_mask = 0xffffffff;
} }
res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
if (res && res != -ENODEV)
return res;
cpmac_get_mac(0, cpmac_low_data.dev_addr); cpmac_get_mac(0, cpmac_low_data.dev_addr);
res = platform_device_register(&cpmac_low); res = platform_device_register(&cpmac_low);
if (res) if (res)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment