From owner-svn-src-all@freebsd.org Fri Jun 12 00:42:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18B9E34797F; Fri, 12 Jun 2020 00:42:07 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jhkk6zH3z4fTV; Fri, 12 Jun 2020 00:42:06 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1F44210A0; Fri, 12 Jun 2020 00:42:06 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05C0g6oP003332; Fri, 12 Jun 2020 00:42:06 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05C0g5SY003327; Fri, 12 Jun 2020 00:42:05 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202006120042.05C0g5SY003327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 12 Jun 2020 00:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362080 - stable/12/sys/dev/e1000 X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/12/sys/dev/e1000 X-SVN-Commit-Revision: 362080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 00:42:07 -0000 Author: erj Date: Fri Jun 12 00:42:05 2020 New Revision: 362080 URL: https://svnweb.freebsd.org/changeset/base/362080 Log: MFC r361805: em(4): Add support for Comet Lake Mobile Platform This change introduces Comet Lake Mobile Platform support in the e1000 driver along with shared code patches described below. - Cast return value of e1000_ltr2ns() to higher type to avoid overflow - Remove useless statement of assigning act_offset - Add initialization of identification LED - Fix flow control setup after connected standby: After connected standby the driver blocks resets during "AdapterStart" and skips flow control setup. This change adds condition in e1000_setup_link_ich8lan() to always setup flow control and to setup physical interface only when there is no need to block resets. Sponsored by: Intel Corporation Modified: stable/12/sys/dev/e1000/e1000_api.c stable/12/sys/dev/e1000/e1000_hw.h stable/12/sys/dev/e1000/e1000_i210.c stable/12/sys/dev/e1000/e1000_ich8lan.c stable/12/sys/dev/e1000/if_em.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/e1000/e1000_api.c ============================================================================== --- stable/12/sys/dev/e1000/e1000_api.c Fri Jun 12 00:01:15 2020 (r362079) +++ stable/12/sys/dev/e1000/e1000_api.c Fri Jun 12 00:42:05 2020 (r362080) @@ -309,6 +309,8 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_SPT_I219_V4: case E1000_DEV_ID_PCH_SPT_I219_LM5: case E1000_DEV_ID_PCH_SPT_I219_V5: + case E1000_DEV_ID_PCH_CMP_I219_LM12: + case E1000_DEV_ID_PCH_CMP_I219_V12: mac->type = e1000_pch_spt; break; case E1000_DEV_ID_PCH_CNP_I219_LM6: @@ -319,7 +321,10 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_ICP_I219_V8: case E1000_DEV_ID_PCH_ICP_I219_LM9: case E1000_DEV_ID_PCH_ICP_I219_V9: - case E1000_DEV_ID_PCH_ICP_I219_V10: + case E1000_DEV_ID_PCH_CMP_I219_LM10: + case E1000_DEV_ID_PCH_CMP_I219_V10: + case E1000_DEV_ID_PCH_CMP_I219_LM11: + case E1000_DEV_ID_PCH_CMP_I219_V11: mac->type = e1000_pch_cnp; break; case E1000_DEV_ID_82575EB_COPPER: Modified: stable/12/sys/dev/e1000/e1000_hw.h ============================================================================== --- stable/12/sys/dev/e1000/e1000_hw.h Fri Jun 12 00:01:15 2020 (r362079) +++ stable/12/sys/dev/e1000/e1000_hw.h Fri Jun 12 00:42:05 2020 (r362080) @@ -155,7 +155,12 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_ICP_I219_V8 0x15E0 #define E1000_DEV_ID_PCH_ICP_I219_LM9 0x15E1 #define E1000_DEV_ID_PCH_ICP_I219_V9 0x15E2 -#define E1000_DEV_ID_PCH_ICP_I219_V10 0x0D4F +#define E1000_DEV_ID_PCH_CMP_I219_LM10 0x0D4E +#define E1000_DEV_ID_PCH_CMP_I219_V10 0x0D4F +#define E1000_DEV_ID_PCH_CMP_I219_LM11 0x0D4C +#define E1000_DEV_ID_PCH_CMP_I219_V11 0x0D4D +#define E1000_DEV_ID_PCH_CMP_I219_LM12 0x0D53 +#define E1000_DEV_ID_PCH_CMP_I219_V12 0x0D55 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 Modified: stable/12/sys/dev/e1000/e1000_i210.c ============================================================================== --- stable/12/sys/dev/e1000/e1000_i210.c Fri Jun 12 00:01:15 2020 (r362079) +++ stable/12/sys/dev/e1000/e1000_i210.c Fri Jun 12 00:42:05 2020 (r362080) @@ -774,6 +774,7 @@ static s32 e1000_get_cfg_done_i210(struct e1000_hw *hw **/ s32 e1000_init_hw_i210(struct e1000_hw *hw) { + struct e1000_mac_info *mac = &hw->mac; s32 ret_val; DEBUGFUNC("e1000_init_hw_i210"); @@ -784,6 +785,10 @@ s32 e1000_init_hw_i210(struct e1000_hw *hw) return ret_val; } hw->phy.ops.get_cfg_done = e1000_get_cfg_done_i210; + + /* Initialize identification LED */ + mac->ops.id_led_init(hw); + ret_val = e1000_init_hw_82575(hw); return ret_val; } Modified: stable/12/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- stable/12/sys/dev/e1000/e1000_ich8lan.c Fri Jun 12 00:01:15 2020 (r362079) +++ stable/12/sys/dev/e1000/e1000_ich8lan.c Fri Jun 12 00:42:05 2020 (r362080) @@ -1091,7 +1091,7 @@ static u64 e1000_ltr2ns(u16 ltr) value = ltr & E1000_LTRV_VALUE_MASK; scale = (ltr & E1000_LTRV_SCALE_MASK) >> E1000_LTRV_SCALE_SHIFT; - return value * (1 << (scale * E1000_LTRV_SCALE_FACTOR)); + return value * (1ULL << (scale * E1000_LTRV_SCALE_FACTOR)); } /** @@ -4161,13 +4161,6 @@ static s32 e1000_update_nvm_checksum_spt(struct e1000_ if (ret_val) goto release; - /* And invalidate the previously valid segment by setting - * its signature word (0x13) high_byte to 0b. This can be - * done without an erase because flash erase sets all bits - * to 1's. We can write 1's to 0's without an erase - */ - act_offset = (old_bank_offset + E1000_ICH_NVM_SIG_WORD) * 2 + 1; - /* offset in words but we read dword*/ act_offset = old_bank_offset + E1000_ICH_NVM_SIG_WORD - 1; ret_val = e1000_read_flash_dword_ich8lan(hw, act_offset, &dword); @@ -5235,9 +5228,6 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *h DEBUGFUNC("e1000_setup_link_ich8lan"); - if (hw->phy.ops.check_reset_block(hw)) - return E1000_SUCCESS; - /* ICH parts do not have a word in the NVM to determine * the default flow control setting, so we explicitly * set it to full. @@ -5253,10 +5243,12 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *h DEBUGOUT1("After fix-ups FlowControl is now = %x\n", hw->fc.current_mode); - /* Continue to configure the copper link. */ - ret_val = hw->mac.ops.setup_physical_interface(hw); - if (ret_val) - return ret_val; + if (!hw->phy.ops.check_reset_block(hw)) { + /* Continue to configure the copper link. */ + ret_val = hw->mac.ops.setup_physical_interface(hw); + if (ret_val) + return ret_val; + } E1000_WRITE_REG(hw, E1000_FCTTV, hw->fc.pause_time); if ((hw->phy.type == e1000_phy_82578) || Modified: stable/12/sys/dev/e1000/if_em.c ============================================================================== --- stable/12/sys/dev/e1000/if_em.c Fri Jun 12 00:01:15 2020 (r362079) +++ stable/12/sys/dev/e1000/if_em.c Fri Jun 12 00:42:05 2020 (r362080) @@ -174,7 +174,12 @@ static pci_vendor_info_t em_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V10, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM10, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V10, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM11, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V11, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM12, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V12, "Intel(R) PRO/1000 Network Connection"), /* required last entry */ PVID_END };