diff options
author | David S. Miller <davem@davemloft.net> | 2013-10-23 16:28:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-23 16:49:34 -0400 |
commit | c3fa32b9764dc45dcf8a2231b1c110abc4a63e0b (patch) | |
tree | 6cf2896a77b65bec64284681e1c3851eb3263e09 /drivers/net/ethernet/davicom | |
parent | 34d92d5315b64a3e5292b7e9511c1bb617227fb6 (diff) | |
parent | 320437af954cbe66478f1f5e8b34cb5a8d072191 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/usb/qmi_wwan.c
include/net/dst.h
Trivial merge conflicts, both were overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/davicom')
-rw-r--r-- | drivers/net/ethernet/davicom/dm9000.c | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index be8efeea51f2..7080ad6c4014 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c | |||
@@ -158,18 +158,6 @@ static inline board_info_t *to_dm9000_board(struct net_device *dev) | |||
158 | 158 | ||
159 | /* DM9000 network board routine ---------------------------- */ | 159 | /* DM9000 network board routine ---------------------------- */ |
160 | 160 | ||
161 | static void | ||
162 | dm9000_reset(board_info_t * db) | ||
163 | { | ||
164 | dev_dbg(db->dev, "resetting device\n"); | ||
165 | |||
166 | /* RESET device */ | ||
167 | writeb(DM9000_NCR, db->io_addr); | ||
168 | udelay(200); | ||
169 | writeb(NCR_RST, db->io_data); | ||
170 | udelay(200); | ||
171 | } | ||
172 | |||
173 | /* | 161 | /* |
174 | * Read a byte from I/O port | 162 | * Read a byte from I/O port |
175 | */ | 163 | */ |
@@ -191,6 +179,27 @@ iow(board_info_t * db, int reg, int value) | |||
191 | writeb(value, db->io_data); | 179 | writeb(value, db->io_data); |
192 | } | 180 | } |
193 | 181 | ||
182 | static void | ||
183 | dm9000_reset(board_info_t *db) | ||
184 | { | ||
185 | dev_dbg(db->dev, "resetting device\n"); | ||
186 | |||
187 | /* Reset DM9000, see DM9000 Application Notes V1.22 Jun 11, 2004 page 29 | ||
188 | * The essential point is that we have to do a double reset, and the | ||
189 | * instruction is to set LBK into MAC internal loopback mode. | ||
190 | */ | ||
191 | iow(db, DM9000_NCR, 0x03); | ||
192 | udelay(100); /* Application note says at least 20 us */ | ||
193 | if (ior(db, DM9000_NCR) & 1) | ||
194 | dev_err(db->dev, "dm9000 did not respond to first reset\n"); | ||
195 | |||
196 | iow(db, DM9000_NCR, 0); | ||
197 | iow(db, DM9000_NCR, 0x03); | ||
198 | udelay(100); | ||
199 | if (ior(db, DM9000_NCR) & 1) | ||
200 | dev_err(db->dev, "dm9000 did not respond to second reset\n"); | ||
201 | } | ||
202 | |||
194 | /* routines for sending block to chip */ | 203 | /* routines for sending block to chip */ |
195 | 204 | ||
196 | static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count) | 205 | static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count) |
@@ -744,15 +753,20 @@ static const struct ethtool_ops dm9000_ethtool_ops = { | |||
744 | static void dm9000_show_carrier(board_info_t *db, | 753 | static void dm9000_show_carrier(board_info_t *db, |
745 | unsigned carrier, unsigned nsr) | 754 | unsigned carrier, unsigned nsr) |
746 | { | 755 | { |
756 | int lpa; | ||
747 | struct net_device *ndev = db->ndev; | 757 | struct net_device *ndev = db->ndev; |
758 | struct mii_if_info *mii = &db->mii; | ||
748 | unsigned ncr = dm9000_read_locked(db, DM9000_NCR); | 759 | unsigned ncr = dm9000_read_locked(db, DM9000_NCR); |
749 | 760 | ||
750 | if (carrier) | 761 | if (carrier) { |
751 | dev_info(db->dev, "%s: link up, %dMbps, %s-duplex, no LPA\n", | 762 | lpa = mii->mdio_read(mii->dev, mii->phy_id, MII_LPA); |
763 | dev_info(db->dev, | ||
764 | "%s: link up, %dMbps, %s-duplex, lpa 0x%04X\n", | ||
752 | ndev->name, (nsr & NSR_SPEED) ? 10 : 100, | 765 | ndev->name, (nsr & NSR_SPEED) ? 10 : 100, |
753 | (ncr & NCR_FDX) ? "full" : "half"); | 766 | (ncr & NCR_FDX) ? "full" : "half", lpa); |
754 | else | 767 | } else { |
755 | dev_info(db->dev, "%s: link down\n", ndev->name); | 768 | dev_info(db->dev, "%s: link down\n", ndev->name); |
769 | } | ||
756 | } | 770 | } |
757 | 771 | ||
758 | static void | 772 | static void |
@@ -890,9 +904,15 @@ dm9000_init_dm9000(struct net_device *dev) | |||
890 | (dev->features & NETIF_F_RXCSUM) ? RCSR_CSUM : 0); | 904 | (dev->features & NETIF_F_RXCSUM) ? RCSR_CSUM : 0); |
891 | 905 | ||
892 | iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ | 906 | iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ |
907 | iow(db, DM9000_GPR, 0); | ||
893 | 908 | ||
894 | dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */ | 909 | /* If we are dealing with DM9000B, some extra steps are required: a |
895 | dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); /* Init */ | 910 | * manual phy reset, and setting init params. |
911 | */ | ||
912 | if (db->type == TYPE_DM9000B) { | ||
913 | dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); | ||
914 | dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); | ||
915 | } | ||
896 | 916 | ||
897 | ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; | 917 | ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; |
898 | 918 | ||