summaryrefslogtreecommitdiffstats
path: root/target/linux/ixp4xx/patches-2.6.25/303-avila_gw23x7_phy_quirk.patch
blob: ece08fd171f83a78954ca0a433e75aab5d91d3af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- a/arch/arm/mach-ixp4xx/avila-setup.c
+++ b/arch/arm/mach-ixp4xx/avila-setup.c
@@ -294,6 +294,7 @@
 
 static void __init avila_gw2347_setup(void)
 {
+	avila_npeb_data.quirks |= IXP4XX_ETH_QUIRK_GW23X7;
 	platform_device_register(&avila_npeb_device);
 
 	avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
@@ -338,6 +339,7 @@
 
 static void __init avila_gw2357_setup(void)
 {
+	avila_npeb_data.quirks |= IXP4XX_ETH_QUIRK_GW23X7;
 	platform_device_register(&avila_npeb_device);
 
 	avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
--- a/drivers/net/arm/ixp4xx_eth.c
+++ b/drivers/net/arm/ixp4xx_eth.c
@@ -348,6 +348,14 @@
 		return;
 	}
 
+	if (port->plat->quirks & IXP4XX_ETH_QUIRK_GW23X7) {
+		mdio_write(dev, 1, 0x19,
+				(mdio_read(dev, 1, 0x19) & 0xfffe) | 0x8000);
+
+		printk(KERN_DEBUG "%s: phy_id of the DP83848 changed to 0\n",
+								dev->name);
+	}
+
 	/* restart auto negotiation */
 	bmcr = mdio_read(dev, phy_id, MII_BMCR);
 	bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART);
--- a/include/asm-arm/arch-ixp4xx/platform.h
+++ b/include/asm-arm/arch-ixp4xx/platform.h
@@ -104,6 +104,8 @@
 	u8 txreadyq;
 	u8 hwaddr[6];
 	u32 phy_mask;
+	u32 quirks;
+#define IXP4XX_ETH_QUIRK_GW23X7		0x00000001
 };
 
 /* Information about built-in HSS (synchronous serial) interfaces */