aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/sunxi/patches-3.13/151-1-stmmac-fixup-1.patch
diff options
context:
space:
mode:
authorZoltan Herpai <wigyori@uid0.hu>2014-03-06 00:09:30 +0000
committerZoltan Herpai <wigyori@uid0.hu>2014-03-06 00:09:30 +0000
commitac4b9dbb3c9b056008e00ee3d02fe3dad65641b7 (patch)
treeef1ef8907c63a75c4ac441f8c95325a6d5abb9ec /target/linux/sunxi/patches-3.13/151-1-stmmac-fixup-1.patch
parent2c771cc71f3b6aceda5fe81f44a79b724e0941d0 (diff)
downloadupstream-ac4b9dbb3c9b056008e00ee3d02fe3dad65641b7.tar.gz
upstream-ac4b9dbb3c9b056008e00ee3d02fe3dad65641b7.tar.bz2
upstream-ac4b9dbb3c9b056008e00ee3d02fe3dad65641b7.zip
sunxi: driver refresh for 3.13 - update gmac / mmc / usb / ahci drivers to follow mainline dev trees - add driver for spi - update clock support - update a31 support - move to new DT compats where appropriate - re-order patchqueue where needed - verified working a20 smp - move most DTSes off files/ - update defconfig
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu> SVN-Revision: 39782
Diffstat (limited to 'target/linux/sunxi/patches-3.13/151-1-stmmac-fixup-1.patch')
-rw-r--r--target/linux/sunxi/patches-3.13/151-1-stmmac-fixup-1.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/target/linux/sunxi/patches-3.13/151-1-stmmac-fixup-1.patch b/target/linux/sunxi/patches-3.13/151-1-stmmac-fixup-1.patch
new file mode 100644
index 0000000000..efd7aff3ba
--- /dev/null
+++ b/target/linux/sunxi/patches-3.13/151-1-stmmac-fixup-1.patch
@@ -0,0 +1,77 @@
+From 9cbadf094d9d479413dc8cfa77dff9e732184337 Mon Sep 17 00:00:00 2001
+From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
+Date: Thu, 16 Jan 2014 10:51:43 +0000
+Subject: [PATCH] net: stmmac: support max-speed device tree property
+
+This patch adds support to "max-speed" property which is a standard
+Ethernet device tree property. max-speed specifies maximum speed
+(specified in megabits per second) supported the device.
+
+Depending on the clocking schemes some of the boards can only support
+few link speeds, so having a way to limit the link speed in the mac
+driver would allow such setups to work reliably.
+
+Without this patch there is no way to tell the driver to limit the
+link speed.
+
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
+Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +++-
+ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 ++++
+ include/linux/stmmac.h | 1 +
+ 3 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+index ecdc8ab..15192c0 100644
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+@@ -776,6 +776,7 @@ static int stmmac_init_phy(struct net_device *dev)
+ char phy_id_fmt[MII_BUS_ID_SIZE + 3];
+ char bus_id[MII_BUS_ID_SIZE];
+ int interface = priv->plat->interface;
++ int max_speed = priv->plat->max_speed;
+ priv->oldlink = 0;
+ priv->speed = 0;
+ priv->oldduplex = -1;
+@@ -800,7 +801,8 @@ static int stmmac_init_phy(struct net_device *dev)
+
+ /* Stop Advertising 1000BASE Capability if interface is not GMII */
+ if ((interface == PHY_INTERFACE_MODE_MII) ||
+- (interface == PHY_INTERFACE_MODE_RMII))
++ (interface == PHY_INTERFACE_MODE_RMII) ||
++ (max_speed < 1000 && max_speed > 0))
+ phydev->advertising &= ~(SUPPORTED_1000baseT_Half |
+ SUPPORTED_1000baseT_Full);
+
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+index 38bd1f4..9377ee6 100644
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+@@ -42,6 +42,10 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
+ *mac = of_get_mac_address(np);
+ plat->interface = of_get_phy_mode(np);
+
++ /* Get max speed of operation from device tree */
++ if (of_property_read_u32(np, "max-speed", &plat->max_speed))
++ plat->max_speed = -1;
++
+ plat->bus_id = of_alias_get_id(np, "ethernet");
+ if (plat->bus_id < 0)
+ plat->bus_id = 0;
+diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
+index bb5deb0..33ace71 100644
+--- a/include/linux/stmmac.h
++++ b/include/linux/stmmac.h
+@@ -110,6 +110,7 @@ struct plat_stmmacenet_data {
+ int force_sf_dma_mode;
+ int force_thresh_dma_mode;
+ int riwt_off;
++ int max_speed;
+ void (*fix_mac_speed)(void *priv, unsigned int speed);
+ void (*bus_setup)(void __iomem *ioaddr);
+ int (*init)(struct platform_device *pdev);
+--
+1.8.5.5
+