Commit b01f6691 authored by Malli Chilakala's avatar Malli Chilakala Committed by Jeff Garzik

[PATCH] e1000: Fixed register and loopback test failures with 82573 controllers

Fixed register and loopback test failures with 82573 controllers
Signed-off-by: default avatarMallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: default avatarGanesh Venkatesan <ganesh.venkatesan@intel.com>
Signed-off-by: default avatarJohn Ronciak <john.ronciak@intel.com>
parent c6963ef5
...@@ -651,6 +651,9 @@ err_setup_rx: ...@@ -651,6 +651,9 @@ err_setup_rx:
E1000_WRITE_REG(&adapter->hw, R, (test[pat] & W)); \ E1000_WRITE_REG(&adapter->hw, R, (test[pat] & W)); \
value = E1000_READ_REG(&adapter->hw, R); \ value = E1000_READ_REG(&adapter->hw, R); \
if(value != (test[pat] & W & M)) { \ if(value != (test[pat] & W & M)) { \
DPRINTK(DRV, ERR, "pattern test reg %04X failed: got " \
"0x%08X expected 0x%08X\n", \
E1000_##R, value, (test[pat] & W & M)); \
*data = (adapter->hw.mac_type < e1000_82543) ? \ *data = (adapter->hw.mac_type < e1000_82543) ? \
E1000_82542_##R : E1000_##R; \ E1000_82542_##R : E1000_##R; \
return 1; \ return 1; \
...@@ -663,7 +666,9 @@ err_setup_rx: ...@@ -663,7 +666,9 @@ err_setup_rx:
uint32_t value; \ uint32_t value; \
E1000_WRITE_REG(&adapter->hw, R, W & M); \ E1000_WRITE_REG(&adapter->hw, R, W & M); \
value = E1000_READ_REG(&adapter->hw, R); \ value = E1000_READ_REG(&adapter->hw, R); \
if ((W & M) != (value & M)) { \ if((W & M) != (value & M)) { \
DPRINTK(DRV, ERR, "set/check reg %04X test failed: got 0x%08X "\
"expected 0x%08X\n", E1000_##R, (value & M), (W & M)); \
*data = (adapter->hw.mac_type < e1000_82543) ? \ *data = (adapter->hw.mac_type < e1000_82543) ? \
E1000_82542_##R : E1000_##R; \ E1000_82542_##R : E1000_##R; \
return 1; \ return 1; \
...@@ -673,18 +678,33 @@ err_setup_rx: ...@@ -673,18 +678,33 @@ err_setup_rx:
static int static int
e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
{ {
uint32_t value; uint32_t value, before, after;
uint32_t i; uint32_t i, toggle;
/* The status register is Read Only, so a write should fail. /* The status register is Read Only, so a write should fail.
* Some bits that get toggled are ignored. * Some bits that get toggled are ignored.
*/ */
value = (E1000_READ_REG(&adapter->hw, STATUS) & (0xFFFFF833)); switch (adapter->hw.mac_type) {
E1000_WRITE_REG(&adapter->hw, STATUS, (0xFFFFFFFF)); case e1000_82573:
if(value != (E1000_READ_REG(&adapter->hw, STATUS) & (0xFFFFF833))) { toggle = 0x7FFFF033;
break;
default:
toggle = 0xFFFFF833;
break;
}
before = E1000_READ_REG(&adapter->hw, STATUS);
value = (E1000_READ_REG(&adapter->hw, STATUS) & toggle);
E1000_WRITE_REG(&adapter->hw, STATUS, toggle);
after = E1000_READ_REG(&adapter->hw, STATUS) & toggle;
if(value != after) {
DPRINTK(DRV, ERR, "failed STATUS register test got: "
"0x%08X expected: 0x%08X\n", after, value);
*data = 1; *data = 1;
return 1; return 1;
} }
/* restore previous status */
E1000_WRITE_REG(&adapter->hw, STATUS, before);
REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF);
REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment