Commit Graph

45 Commits

Author SHA1 Message Date
msaitoh fa0800bb31 Add SFP support part 1. The code for SerDes and SGMII setting is not include
in this commit. SFP module removal interrupt detects but not used yet:
- Detect SFP's 1000BASE-SX, 1000BASE-LX, 100BASE-FX and 1000BASE-T correctly.
- Detect the Media Auto Sense feature. Not supported yet.
- Add comment.
2019-12-11 10:28:19 +00:00
msaitoh 6c3f577b44 Modify PHY tree in comment. 2019-02-19 07:59:17 +00:00
msaitoh 0e8a4e719a Swap enumeration of 82578 and 82577. Same as FreeBSD. Chip Model number of
82578 is +1 from 82577 but 82577 is functionally newer than 82578 (and 82577's
MII_MODEL(0x05) is greater than 82578's (0x04)). This change doesn't affect any
behavior to if_wm.c (NFCI).

 Add comment.
2019-02-07 10:29:53 +00:00
msaitoh e65f94046b Add comment. 2018-12-25 07:41:21 +00:00
msaitoh 8e20597aca - Don't setup WoL on non-WoL capable port.
- Setup PHY wakeup feature on PCH and newer. Tested on Thinkpad X220.
2018-12-20 09:32:12 +00:00
msaitoh e4a61aa443 Print CLSEM workaround bit correctly. 2018-12-14 06:28:09 +00:00
msaitoh 37bfea848b Add MDIC_WA and CLSEMWA to snprintb() string for WM_F_* flags. 2018-08-08 03:15:18 +00:00
msaitoh 377872ea64 Add PCH_CNP support (I219 with Intel 300 series chipset).
It's required more test, so it's disabled by default.
2018-04-12 03:25:08 +00:00
msaitoh fd411f94be Add WM_F_WA_I210_CLSEM flag for a workaround. FreeBSD/Linux drivers say
"In rare circumstances, the SW semaphore may already be held unintentionally."
on I21[01]. PXE boot is one of the case.

XXX pullup-[678].
2017-07-27 03:21:42 +00:00
msaitoh 7c8895a613 - Our MII readreg/writereg API has not way to detect an error.
kmrn_{read,write}reg() are not used for MII API, so it's not required for
  these functions to use the same API. So,
  - Change return value as error code.
  - Change register vaule from int to uint16_t.
  - read: pass pointer for uint16_t as an argument.
  - Check return value on caller side.
- Check whether it's required to use MDIC workaround for 80003 or not in
  wm_reset(). If the workaround isn't required, don't use the workaround code
  in wm_gmii_i80003_{read,write}reg.
2017-07-26 06:48:49 +00:00
msaitoh 7763223482 Use new nvm.{acquire,release}() for semaphore. Almost the same except the
following:
 - 8257[12]: Don't directly access SPI but use EERD register.
 - 82575-I354: If the size of SPI ROM >= 32K words, use direct SPI access
   instead of EERD register access.
 - Add wm_nvm_eec_clock_raise() and wm_nvm_eec_clock_lower() and use them for
   Microwire/SPI bus control. Same as Linux and FreeBSD.
 - Redude timeout value for 80003 in wm_get_swfw_semaphore(). Same as
   Linux and FreeBSD.
2017-07-25 06:00:17 +00:00
msaitoh de3925eaed Print sc_flags with snprintb(). 2017-06-26 04:03:34 +00:00
msaitoh 1056630786 Use new wm_gmii_setup_phytype() function to setup sc_phytype and
mii_{read|write}reg. This function is called twie.

 To identify PHY type, correct read/write function should be selected. To
select correct read/write function, PCI ID or MAC type are required without
accessing PHY registers.

 On the first call of this function, PHY ID is not known yet. Check PCI ID or
MAC type. The list of the PCI ID may not be perfect, so the result might be
incorrect.

 In the second call, PHY OUI and model are used to identify PHY type. It might
not be perfpect because of the lack of compared entry, but it would be better
than the first call.

 If the detected new result and previous assumption is different, diagnous
message will be printed.
2017-02-01 08:56:41 +00:00
msaitoh f1c537b246 - Define WMPHY_I217, WMPHY_VF and WMPHY_210.
- Use BME1000_PHY_PAGE_SELECT in wm_gmii_bm_{read,write}reg(). This change has
  no effect because GG82563_PHY_PAGE_SELECT and BME1000_PHY_PAGE_SELECT have
  the same value.
2016-10-28 06:27:11 +00:00
msaitoh b1649a9bff Basic support for I219. It doesn't work on I219, so it's disabled. 2016-05-06 08:56:20 +00:00
msaitoh 0263b84cb0 - Fix RAL table's size of PCH2 and PCH_LPT.
- PCH_LPT (and newer device) is required to check FWSM_WLOCK_MAC bit to
  determine the range of the RAL.
- Fix typo in comment and modify comment by tnn@.
- Rename wm_check_reset_block() to wm_phy_resetisblocked() and make it returns
  bool. No functional change.
2015-12-25 04:50:16 +00:00
msaitoh 762e3152b5 - Add workaround for I210 Errata 25 and I211 Errata 10.
- Add wm_gmii_gs40g_{read|write}reg() and use it to access non-standatrd
     page.
   - Add wm_pll_workaround_i210() and call it when
       chip is i211
       chip is i210 and it use INVM
       chip is i210 and NVM image version < 3.25
- Add comment
- Rename macros.
2015-06-06 04:39:12 +00:00
msaitoh 86fd0298c3 Print NVM image version. 2015-06-06 03:38:40 +00:00
msaitoh f5088cc0cd Revert previos. Sorry, I committed in another working directory... 2015-06-06 03:37:01 +00:00
msaitoh 529e969f1d Print NVM image version. 2015-06-06 03:33:37 +00:00
msaitoh 9437f450fa Fix a lot of bugs to make 82575 and newer's SERDES based systems work.
- Add SERDES specific functions.
 - Fix IO pin configuration.
 - Reset autonego timer when link becomes up.

TODO:
 - Fix a bug that SFP ROM can't read.
 - Perhaps some work is required for 8257[12] serdes systems.
 - Remove duplicated code in TBI's link related functions.
2015-06-02 14:19:26 +00:00
msaitoh 12506c1da0 Add support iNVM (integrated Non-Volatile Memory) for I21[01]. This change
fixes a bug that a MAC address is wrongly set on iNVM machines and NICs.
Tested with Shuttle DS57U(iNVM based) and other non iNVM based I210 machines.
2015-05-16 22:41:59 +00:00
msaitoh c21485979e Fix typo in comment. 2014-11-27 11:42:02 +00:00
msaitoh c36aa68bf4 Add note about the variations of Intel gigabit Ethernet controller. 2014-11-25 05:05:16 +00:00
msaitoh ccce967123 Delete 82580ER related code. It was from FreeBSD and was removed in r203049. 2014-10-06 07:31:24 +00:00
msaitoh 49592136f0 Set the WM_F_ATTACHED flag if wm_attach() finished succesfully and check
the flag in wm_detach(). It will avoid to panic in wm_detach().
Fixes PR#49102.
2014-08-24 21:15:35 +00:00
msaitoh 524cb011c0 Cleanup comments. No functional change. 2014-07-14 05:00:18 +00:00
msaitoh 93c479cffc Rename some WM_F_* flags to clarify. Renumbering flags. No functional change.
WM_F_EEPROM_HANDSHAKE -> WM_F_LOCK_EECD
 WM_F_EEPROM_SEMAPHORE -> WM_F_LOCK_SWSM
 WM_F_SWFW_SYNC        -> WM_F_LOCK_SWFW
 WM_F_SWFWHW_SYNC      -> WM_F_LOCK_EXTCNF
2014-07-11 08:34:27 +00:00
msaitoh bcf70d1755 Add support For I354(C2000 interna Ethernet controller):
- Add I354 support.
 - Fix SGMII+MDIO case. SGMII+I2C is not supported yet.
 - Not tested well.
 - Sprinkle "XXX" to check later.
2013-12-29 21:28:41 +00:00
msaitoh d403328cb4 Add I217 (and I218) support.
- The name of I217 is similar to I210, but the function is rather similar to
  PCH2.
- Not tested well. Tested with my own Intel DQ87PG which has I217LM onboard.
- It seems that PCH2 and PCH_LPT specific function for RAL should be written.
- Quick hack for the NVM checksum mismatch. if_wm.c currently has no
  wm_write_eeprom(), so it cannot update NVM's "updated bit". To avoid this
  problem, check only the last 12bits of the checksum. My own DQ87PG's
  updated bit is not set, and I could avoid the problem using with this
  hack.
2013-06-02 09:36:22 +00:00
msaitoh bed482c44e Add support I21[01]. Only tested with my own I210-T1 Ethernet Server Adapter. 2013-04-18 12:42:03 +00:00
msaitoh 3e372ca912 Use 82580(and I350) specific PHY read/write functions.
Fixes PR#47542.
2013-02-12 03:11:43 +00:00
msaitoh 87f3b34aa5 Add support Intel I350 Ethernet. 2012-05-25 23:37:37 +00:00
msaitoh 40d6eb691f Add PCH2 support. 2011-05-20 01:51:36 +00:00
msaitoh b15cf397d8 - Add code for WOL, ASF, IPMI and Intel AMT.
- wm_enable_wakeup() is disabled by default. If you want to use WOL with
      the Magic Packet, define WM_WOL.
    - Add the following flags:
        WM_F_ASF_FIRMWARE_PRESENT
        WM_F_ARC_SUBSYSTEM_VALID
        WM_F_HAS_AMT
        WM_F_HAS_MANAGE
        WM_F_WOL
    - Add wm_suspend() and wm_resume(). Give/get the control to/from the
      firmware.
    - Need more work for PCH. See wm_enable_phy_wakeup().
- Enable wm_get_hw_control() for 82574 and 82583.
- Add Yet another workaround for ICH8.
    - Add wm_igp3_phy_powerdown_workaround_ich8lan() for power down problem
      on D3.
2010-03-07 09:05:19 +00:00
msaitoh b32bc8f5ec Merge if_wm.c rev. 1.162.4.13 and if_wmvar.h rev. 1.2.46.3 into maintrunk.
Increase the timeout value to prevent timeout on 80003. The values are taken
from Intel's e1000 driver. Tested by spz and me.
2010-02-25 15:07:06 +00:00
msaitoh b601f7daf0 Add support for 82575, 82576 and 82580(ER).
- Apply the patch for 82575 from Wolfgang Stukenbrock (PR#42422). We use
  only one RX ring and with the legacy mode.
- Add support for 82576.
- Partial support for 82580.
- Partial support for the serdes systems.
2010-02-16 15:17:17 +00:00
msaitoh 86ff2cac75 Fixes the rx stall problem on 82578 by MANY workaround code.
We need more work for 82577.
2010-01-14 18:56:01 +00:00
msaitoh 0806c4114c Add partial support for PCH. We have to do more work for PCH. Especially
I don't know what driver i82578 should be attached to. makephy? or atphy?
MII_OUI() says that the PHY is from Attansic (== Atheros). Intel's e1000
driver says that it's close to makphy...

 I can't link up at 1000BaseT yet...
2010-01-11 12:29:28 +00:00
msaitoh ddef6db304 Make wm_reset() and wm_gmii_reset() close to e1000 driver.
At least, this change make wm_attach() stable on ICH9.
2010-01-07 17:45:58 +00:00
msaitoh 168809dd71 - Fix an incorrect test for WM_F_EEPROM_INVALID since rev. 1.183. Some old
chips don't set EECD_EE_PRES.
- Fix a bug that both WM_F_EEPROM_SPI and WM_F_EEPROM_FLASH are set.
- Add a missing decrement for a timeout reported by Wolfgang Stukenbrock
  in PR#42422.
- Add support for i82583V.
- PBA setting for i82574 is not 12K but 20K.
- Enable checking the management mode on 82574.
2009-12-29 16:01:21 +00:00
msaitoh 05b467b58c Sync with Intel's original em driver:
- Add dspcode for igp3 and use it when the EEPROM isn't available.
- Add some delays.
- Stop the PHY transmitter before patching the DSP code and restart it after wrote.
- Save and restore register 0x2f5b.
2009-12-16 14:37:26 +00:00
msaitoh f03b836566 Re-enable igphy's 82566 support.
- Patch for the DSP code is only for 8254[17] and we have to apply the
   different patches between rev. 1 and rev. 2.
 - The workaround for analog fuse is only for 82547 rev. 1.
 - The workaround for smartspeed is only for 8254[17]

see http://mail-index.netbsd.org/tech-net/2009/08/05/msg001546.html
2009-12-16 04:50:35 +00:00
gavan fc631497e1 Convert MD hook to device property reads.
Device properties, if present, take precedence over EEPROM values.
2006-02-22 00:17:43 +00:00
gavan 7600be39ae Compute the EEPROM checksum to determine the presence of valid EEPROM data.
If EEPROM data is invalid, allow a MD hook to supply EEPROM data instead.
2006-02-16 00:02:00 +00:00