diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2006-06-27 12:08:22 -0400 |
---|---|---|
committer | Auke Kok <juke-jan.h.kok@intel.com> | 2006-06-27 12:08:22 -0400 |
commit | cd94dd0b648ceb64ca5e41d9ccfa99c1e30e92ef (patch) | |
tree | 48144ae7c119c5cc7e61d42c670609540c3c7e9d /drivers/net/e1000/e1000_ethtool.c | |
parent | d37ea5d56293b7a883d2a993df5d8b9fb660ed3b (diff) |
e1000: integrate ich8 support into driver
This hooks up the ich8 structure into the driver itself.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Diffstat (limited to 'drivers/net/e1000/e1000_ethtool.c')
-rw-r--r-- | drivers/net/e1000/e1000_ethtool.c | 80 |
1 files changed, 58 insertions, 22 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index 060915532923..3a0b847fac31 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c | |||
@@ -109,7 +109,8 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
109 | SUPPORTED_1000baseT_Full| | 109 | SUPPORTED_1000baseT_Full| |
110 | SUPPORTED_Autoneg | | 110 | SUPPORTED_Autoneg | |
111 | SUPPORTED_TP); | 111 | SUPPORTED_TP); |
112 | 112 | if (hw->phy_type == e1000_phy_ife) | |
113 | ecmd->supported &= ~SUPPORTED_1000baseT_Full; | ||
113 | ecmd->advertising = ADVERTISED_TP; | 114 | ecmd->advertising = ADVERTISED_TP; |
114 | 115 | ||
115 | if (hw->autoneg == 1) { | 116 | if (hw->autoneg == 1) { |
@@ -573,6 +574,7 @@ e1000_get_drvinfo(struct net_device *netdev, | |||
573 | case e1000_82572: | 574 | case e1000_82572: |
574 | case e1000_82573: | 575 | case e1000_82573: |
575 | case e1000_80003es2lan: | 576 | case e1000_80003es2lan: |
577 | case e1000_ich8lan: | ||
576 | sprintf(firmware_version, "%d.%d-%d", | 578 | sprintf(firmware_version, "%d.%d-%d", |
577 | (eeprom_data & 0xF000) >> 12, | 579 | (eeprom_data & 0xF000) >> 12, |
578 | (eeprom_data & 0x0FF0) >> 4, | 580 | (eeprom_data & 0x0FF0) >> 4, |
@@ -757,6 +759,7 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) | |||
757 | toggle = 0x7FFFF3FF; | 759 | toggle = 0x7FFFF3FF; |
758 | break; | 760 | break; |
759 | case e1000_82573: | 761 | case e1000_82573: |
762 | case e1000_ich8lan: | ||
760 | toggle = 0x7FFFF033; | 763 | toggle = 0x7FFFF033; |
761 | break; | 764 | break; |
762 | default: | 765 | default: |
@@ -776,11 +779,12 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) | |||
776 | } | 779 | } |
777 | /* restore previous status */ | 780 | /* restore previous status */ |
778 | E1000_WRITE_REG(&adapter->hw, STATUS, before); | 781 | E1000_WRITE_REG(&adapter->hw, STATUS, before); |
779 | 782 | if (adapter->hw.mac_type != e1000_ich8lan) { | |
780 | REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); | 783 | REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); |
781 | REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); | 784 | REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); |
782 | REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF); | 785 | REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF); |
783 | REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF); | 786 | REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF); |
787 | } | ||
784 | REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF); | 788 | REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF); |
785 | REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF); | 789 | REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF); |
786 | REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF); | 790 | REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF); |
@@ -793,20 +797,22 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) | |||
793 | REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF); | 797 | REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF); |
794 | 798 | ||
795 | REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000); | 799 | REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000); |
796 | REG_SET_AND_CHECK(RCTL, 0x06DFB3FE, 0x003FFFFB); | 800 | before = (adapter->hw.mac_type == e1000_ich8lan ? |
801 | 0x06C3B33E : 0x06DFB3FE); | ||
802 | REG_SET_AND_CHECK(RCTL, before, 0x003FFFFB); | ||
797 | REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000); | 803 | REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000); |
798 | 804 | ||
799 | if (adapter->hw.mac_type >= e1000_82543) { | 805 | if (adapter->hw.mac_type >= e1000_82543) { |
800 | 806 | ||
801 | REG_SET_AND_CHECK(RCTL, 0x06DFB3FE, 0xFFFFFFFF); | 807 | REG_SET_AND_CHECK(RCTL, before, 0xFFFFFFFF); |
802 | REG_PATTERN_TEST(RDBAL, 0xFFFFFFF0, 0xFFFFFFFF); | 808 | REG_PATTERN_TEST(RDBAL, 0xFFFFFFF0, 0xFFFFFFFF); |
803 | REG_PATTERN_TEST(TXCW, 0xC000FFFF, 0x0000FFFF); | 809 | if (adapter->hw.mac_type != e1000_ich8lan) |
810 | REG_PATTERN_TEST(TXCW, 0xC000FFFF, 0x0000FFFF); | ||
804 | REG_PATTERN_TEST(TDBAL, 0xFFFFFFF0, 0xFFFFFFFF); | 811 | REG_PATTERN_TEST(TDBAL, 0xFFFFFFF0, 0xFFFFFFFF); |
805 | REG_PATTERN_TEST(TIDV, 0x0000FFFF, 0x0000FFFF); | 812 | REG_PATTERN_TEST(TIDV, 0x0000FFFF, 0x0000FFFF); |
806 | 813 | value = (adapter->hw.mac_type == e1000_ich8lan ? | |
807 | for (i = 0; i < E1000_RAR_ENTRIES; i++) { | 814 | E1000_RAR_ENTRIES_ICH8LAN : E1000_RAR_ENTRIES); |
808 | REG_PATTERN_TEST(RA + ((i << 1) << 2), 0xFFFFFFFF, | 815 | for (i = 0; i < value; i++) { |
809 | 0xFFFFFFFF); | ||
810 | REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF, | 816 | REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF, |
811 | 0xFFFFFFFF); | 817 | 0xFFFFFFFF); |
812 | } | 818 | } |
@@ -820,7 +826,9 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) | |||
820 | 826 | ||
821 | } | 827 | } |
822 | 828 | ||
823 | for (i = 0; i < E1000_MC_TBL_SIZE; i++) | 829 | value = (adapter->hw.mac_type == e1000_ich8lan ? |
830 | E1000_MC_TBL_SIZE_ICH8LAN : E1000_MC_TBL_SIZE); | ||
831 | for (i = 0; i < value; i++) | ||
824 | REG_PATTERN_TEST(MTA + (i << 2), 0xFFFFFFFF, 0xFFFFFFFF); | 832 | REG_PATTERN_TEST(MTA + (i << 2), 0xFFFFFFFF, 0xFFFFFFFF); |
825 | 833 | ||
826 | *data = 0; | 834 | *data = 0; |
@@ -892,6 +900,8 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data) | |||
892 | /* Test each interrupt */ | 900 | /* Test each interrupt */ |
893 | for (; i < 10; i++) { | 901 | for (; i < 10; i++) { |
894 | 902 | ||
903 | if (adapter->hw.mac_type == e1000_ich8lan && i == 8) | ||
904 | continue; | ||
895 | /* Interrupt to test */ | 905 | /* Interrupt to test */ |
896 | mask = 1 << i; | 906 | mask = 1 << i; |
897 | 907 | ||
@@ -1251,16 +1261,31 @@ e1000_integrated_phy_loopback(struct e1000_adapter *adapter) | |||
1251 | GG82563_PHY_KMRN_MODE_CTRL, | 1261 | GG82563_PHY_KMRN_MODE_CTRL, |
1252 | 0x1CC); | 1262 | 0x1CC); |
1253 | } | 1263 | } |
1254 | /* force 1000, set loopback */ | ||
1255 | e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x4140); | ||
1256 | 1264 | ||
1257 | /* Now set up the MAC to the same speed/duplex as the PHY. */ | ||
1258 | ctrl_reg = E1000_READ_REG(&adapter->hw, CTRL); | 1265 | ctrl_reg = E1000_READ_REG(&adapter->hw, CTRL); |
1259 | ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */ | 1266 | |
1260 | ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */ | 1267 | if (adapter->hw.phy_type == e1000_phy_ife) { |
1261 | E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */ | 1268 | /* force 100, set loopback */ |
1262 | E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */ | 1269 | e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x6100); |
1263 | E1000_CTRL_FD); /* Force Duplex to FULL */ | 1270 | |
1271 | /* Now set up the MAC to the same speed/duplex as the PHY. */ | ||
1272 | ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */ | ||
1273 | ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */ | ||
1274 | E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */ | ||
1275 | E1000_CTRL_SPD_100 |/* Force Speed to 100 */ | ||
1276 | E1000_CTRL_FD); /* Force Duplex to FULL */ | ||
1277 | } else { | ||
1278 | /* force 1000, set loopback */ | ||
1279 | e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x4140); | ||
1280 | |||
1281 | /* Now set up the MAC to the same speed/duplex as the PHY. */ | ||
1282 | ctrl_reg = E1000_READ_REG(&adapter->hw, CTRL); | ||
1283 | ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */ | ||
1284 | ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */ | ||
1285 | E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */ | ||
1286 | E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */ | ||
1287 | E1000_CTRL_FD); /* Force Duplex to FULL */ | ||
1288 | } | ||
1264 | 1289 | ||
1265 | if (adapter->hw.media_type == e1000_media_type_copper && | 1290 | if (adapter->hw.media_type == e1000_media_type_copper && |
1266 | adapter->hw.phy_type == e1000_phy_m88) { | 1291 | adapter->hw.phy_type == e1000_phy_m88) { |
@@ -1320,6 +1345,7 @@ e1000_set_phy_loopback(struct e1000_adapter *adapter) | |||
1320 | case e1000_82572: | 1345 | case e1000_82572: |
1321 | case e1000_82573: | 1346 | case e1000_82573: |
1322 | case e1000_80003es2lan: | 1347 | case e1000_80003es2lan: |
1348 | case e1000_ich8lan: | ||
1323 | return e1000_integrated_phy_loopback(adapter); | 1349 | return e1000_integrated_phy_loopback(adapter); |
1324 | break; | 1350 | break; |
1325 | 1351 | ||
@@ -1786,6 +1812,16 @@ e1000_phys_id(struct net_device *netdev, uint32_t data) | |||
1786 | mod_timer(&adapter->blink_timer, jiffies); | 1812 | mod_timer(&adapter->blink_timer, jiffies); |
1787 | msleep_interruptible(data * 1000); | 1813 | msleep_interruptible(data * 1000); |
1788 | del_timer_sync(&adapter->blink_timer); | 1814 | del_timer_sync(&adapter->blink_timer); |
1815 | } else if (adapter->hw.phy_type == e1000_phy_ife) { | ||
1816 | if (!adapter->blink_timer.function) { | ||
1817 | init_timer(&adapter->blink_timer); | ||
1818 | adapter->blink_timer.function = e1000_led_blink_callback; | ||
1819 | adapter->blink_timer.data = (unsigned long) adapter; | ||
1820 | } | ||
1821 | mod_timer(&adapter->blink_timer, jiffies); | ||
1822 | msleep_interruptible(data * 1000); | ||
1823 | del_timer_sync(&adapter->blink_timer); | ||
1824 | e1000_write_phy_reg(&(adapter->hw), IFE_PHY_SPECIAL_CONTROL_LED, 0); | ||
1789 | } else { | 1825 | } else { |
1790 | e1000_blink_led_start(&adapter->hw); | 1826 | e1000_blink_led_start(&adapter->hw); |
1791 | msleep_interruptible(data * 1000); | 1827 | msleep_interruptible(data * 1000); |