[linux-yocto] [PATCH 40/89] drivers/net: Switched back to the broken, but sort of works, version.
Paul Butler
butler.paul at gmail.com
Sun Oct 27 12:33:05 PDT 2013
From: John Jacques <john.jacques at lsi.com>
Signed-off-by: John Jacques <john.jacques at lsi.com>
---
drivers/net/ethernet/lsi/lsi_acp_net.c | 39 +++++++++++++++++++++++++---------
1 file changed, 29 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/lsi/lsi_acp_net.c b/drivers/net/ethernet/lsi/lsi_acp_net.c
index c8b923b..6069aa7 100644
--- a/drivers/net/ethernet/lsi/lsi_acp_net.c
+++ b/drivers/net/ethernet/lsi/lsi_acp_net.c
@@ -1874,7 +1874,15 @@ void disable_nic_(void)
static int
phy_read_(int phy, int reg, unsigned short *value)
{
- return acp_mdio_read(phy, reg, value);
+ int rc;
+
+ rc = acp_mdio_read(phy, reg, value);
+#if 0
+ printk("phy_read: read 0x%x from reg 0x%x (phy 0x%x, rc %d)\n",
+ *value, reg, phy, rc);
+#endif
+
+ return rc;
}
/*
@@ -1885,7 +1893,15 @@ phy_read_(int phy, int reg, unsigned short *value)
static int
phy_write_(int phy, int reg, unsigned short value)
{
- return acp_mdio_write(phy, reg, value);
+ int rc;
+
+ rc = acp_mdio_write(phy, reg, value);
+#if 0
+ printk("phy_write: wrote 0x%x to reg 0x%x (phy 0x%x, rc %d)\n",
+ value, reg, phy, rc);
+#endif
+
+ return rc;
}
/*
@@ -2027,7 +2043,7 @@ phy_renegotiate_(int phy)
int autoneg_retries = 4;
int autoneg_complete_retries = 20;
- printk(KERN_INFO "Initiating Auto Negotiation");
+ printk(KERN_INFO "Initiating Auto Negotiation (phy 0x%x)", phy);
phy_write_(phy, PHY_AUTONEG_ADVERTISE, 0x61);
#if defined(PHY_DEBUG)
/*Debug Code */
@@ -2087,6 +2103,8 @@ static int phy_enable_(struct net_device *device)
phy_id_low_t phy_id_low_;
unsigned char phyaddr_string_[40];
+ printk("%d - apnd->phy_address=0x%x\n", __LINE__, apnd->phy_address);
+
if (0 == phy_read_(apnd->phy_address, PHY_ID_HIGH, &phy_id_high_.raw)) {
PHY_DEBUG_PRINT("Read PHY_ID_HIGH as 0x%x on mdio addr 0x%x.\n",
phy_id_high_.raw, apnd->phy_address);
@@ -2117,19 +2135,13 @@ static int phy_enable_(struct net_device *device)
unsigned short value;
int rc;
- /* Access Shadow reg 0x1d */
rc = phy_read_(0x1e, PHY_BCM_TEST_REG, &value);
+ /* Access Shadow reg 0x1d */
value = value | 0x80;
rc |= phy_write_(0x1e, PHY_BCM_TEST_REG, value);
/* Set RX FIFO size to 0x7 */
rc |= phy_write_(0x1e, PHY_AUXILIARY_MODE3, 0x7);
-
- /* Access Normal Registers */
- rc = phy_read_(0x1e, PHY_BCM_TEST_REG, &value);
- value = value & ~0x80;
- rc |= phy_write_(0x1e, PHY_BCM_TEST_REG, value);
-
if (rc != 0) {
return rc;
}
@@ -2524,6 +2536,8 @@ static irqreturn_t appnic_isr_(int irq, void *device_id)
TRACE_BEGINNING();
LSINET_COUNTS_INC(LSINET_COUNTS_ISR_START);
+ /*printk("%d - phy_address=0x%x\n", __LINE__, appnic_device->phy_address);*/
+
/* Acquire the lock */
spin_lock_irqsave(&dev_->lock, flags);
@@ -3102,6 +3116,11 @@ appnic_init(struct net_device *device)
TRACE_BEGINNING();
+ /*adapter->phy_address = 0x1e;*/
+
+ /* Set the FEMAC to uncached. */
+ /*writel( 0, (GPREG + 0x78));*/
+
/*
* Reset the MAC
*/
--
1.8.3.4
More information about the linux-yocto
mailing list