Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214566
b: refs/heads/master
c: dfb8fb9
h: refs/heads/master
v: v3
  • Loading branch information
Giuseppe CAVALLARO authored and David S. Miller committed Sep 17, 2010
1 parent 9b391d3 commit fa075b6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 67c9660831f6b6b76866a0838466c83765ffbbd3
refs/heads/master: dfb8fb96ae2b5126cd0c08c0ccd7c42e1f46568a
1 change: 1 addition & 0 deletions trunk/drivers/net/stmmac/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct stmmac_priv {
unsigned int flow_ctrl;
unsigned int pause;
struct mii_bus *mii;
int mii_clk_csr;

u32 msg_enable;
spinlock_t lock;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
plat_dat = pdev->dev.platform_data;
priv->bus_id = plat_dat->bus_id;
priv->pbl = plat_dat->pbl; /* TLI */
priv->mii_clk_csr = plat_dat->clk_csr;
priv->is_gmac = plat_dat->has_gmac; /* GMAC is on board */
priv->enh_desc = plat_dat->enh_desc;
priv->ioaddr = addr;
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/net/stmmac/stmmac_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int stmmac_mdio_read(struct mii_bus *bus, int phyaddr, int phyreg)
int data;
u16 regValue = (((phyaddr << 11) & (0x0000F800)) |
((phyreg << 6) & (0x000007C0)));
regValue |= MII_BUSY; /* in case of GMAC */
regValue |= MII_BUSY | ((priv->mii_clk_csr & 7) << 2);

do {} while (((readl(priv->ioaddr + mii_address)) & MII_BUSY) == 1);
writel(regValue, priv->ioaddr + mii_address);
Expand Down Expand Up @@ -85,7 +85,8 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
(((phyaddr << 11) & (0x0000F800)) | ((phyreg << 6) & (0x000007C0)))
| MII_WRITE;

value |= MII_BUSY;
value |= MII_BUSY | ((priv->mii_clk_csr & 7) << 2);


/* Wait until any existing MII operation is complete */
do {} while (((readl(priv->ioaddr + mii_address)) & MII_BUSY) == 1);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
struct plat_stmmacenet_data {
int bus_id;
int pbl;
int clk_csr;
int has_gmac;
int enh_desc;
void (*fix_mac_speed)(void *priv, unsigned int speed);
Expand Down

0 comments on commit fa075b6

Please sign in to comment.