Deleted Added
full compact
e1000_i210.c (287990) e1000_i210.c (295323)
1/******************************************************************************
2
3 Copyright (c) 2001-2015, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
1/******************************************************************************
2
3 Copyright (c) 2001-2015, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
33/*$FreeBSD: head/sys/dev/e1000/e1000_i210.c 287990 2015-09-19 18:22:59Z sbruno $*/
33/*$FreeBSD: head/sys/dev/e1000/e1000_i210.c 295323 2016-02-05 17:14:37Z erj $*/
34
35#include "e1000_api.h"
36
37
38static s32 e1000_acquire_nvm_i210(struct e1000_hw *hw);
39static void e1000_release_nvm_i210(struct e1000_hw *hw);
40static s32 e1000_get_hw_semaphore_i210(struct e1000_hw *hw);
41static s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,

--- 836 unchanged lines hidden (view full) ---

878 E1000_WRITE_REG(hw, E1000_WUC, wuc);
879 }
880 /* restore MDICNFG setting */
881 E1000_WRITE_REG(hw, E1000_MDICNFG, mdicnfg);
882 return ret_val;
883}
884
885/**
34
35#include "e1000_api.h"
36
37
38static s32 e1000_acquire_nvm_i210(struct e1000_hw *hw);
39static void e1000_release_nvm_i210(struct e1000_hw *hw);
40static s32 e1000_get_hw_semaphore_i210(struct e1000_hw *hw);
41static s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,

--- 836 unchanged lines hidden (view full) ---

878 E1000_WRITE_REG(hw, E1000_WUC, wuc);
879 }
880 /* restore MDICNFG setting */
881 E1000_WRITE_REG(hw, E1000_MDICNFG, mdicnfg);
882 return ret_val;
883}
884
885/**
886 * e1000_get_cfg_done_i210 - Read config done bit
887 * @hw: pointer to the HW structure
888 *
889 * Read the management control register for the config done bit for
890 * completion status. NOTE: silicon which is EEPROM-less will fail trying
891 * to read the config done bit, so an error is *ONLY* logged and returns
892 * E1000_SUCCESS. If we were to return with error, EEPROM-less silicon
893 * would not be able to be reset or change link.
894 **/
895static s32 e1000_get_cfg_done_i210(struct e1000_hw *hw)
896{
897 s32 timeout = PHY_CFG_TIMEOUT;
898 u32 mask = E1000_NVM_CFG_DONE_PORT_0;
899
900 DEBUGFUNC("e1000_get_cfg_done_i210");
901
902 while (timeout) {
903 if (E1000_READ_REG(hw, E1000_EEMNGCTL_I210) & mask)
904 break;
905 msec_delay(1);
906 timeout--;
907 }
908 if (!timeout)
909 DEBUGOUT("MNG configuration cycle has not completed.\n");
910
911 return E1000_SUCCESS;
912}
913
914/**
886 * e1000_init_hw_i210 - Init hw for I210/I211
887 * @hw: pointer to the HW structure
888 *
889 * Called to initialize hw for i210 hw family.
890 **/
891s32 e1000_init_hw_i210(struct e1000_hw *hw)
892{
893 s32 ret_val;
894
895 DEBUGFUNC("e1000_init_hw_i210");
896 if ((hw->mac.type >= e1000_i210) &&
897 !(e1000_get_flash_presence_i210(hw))) {
898 ret_val = e1000_pll_workaround_i210(hw);
899 if (ret_val != E1000_SUCCESS)
900 return ret_val;
901 }
915 * e1000_init_hw_i210 - Init hw for I210/I211
916 * @hw: pointer to the HW structure
917 *
918 * Called to initialize hw for i210 hw family.
919 **/
920s32 e1000_init_hw_i210(struct e1000_hw *hw)
921{
922 s32 ret_val;
923
924 DEBUGFUNC("e1000_init_hw_i210");
925 if ((hw->mac.type >= e1000_i210) &&
926 !(e1000_get_flash_presence_i210(hw))) {
927 ret_val = e1000_pll_workaround_i210(hw);
928 if (ret_val != E1000_SUCCESS)
929 return ret_val;
930 }
931 hw->phy.ops.get_cfg_done = e1000_get_cfg_done_i210;
902 ret_val = e1000_init_hw_82575(hw);
903 return ret_val;
904}
932 ret_val = e1000_init_hw_82575(hw);
933 return ret_val;
934}