Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/e1000/e1000_82540.c
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* e1000_init_phy_params_82540 - Init PHY func ptrs. | * e1000_init_phy_params_82540 - Init PHY func ptrs. | ||||
* @hw: pointer to the HW structure | * @hw: pointer to the HW structure | ||||
**/ | **/ | ||||
static s32 e1000_init_phy_params_82540(struct e1000_hw *hw) | static s32 e1000_init_phy_params_82540(struct e1000_hw *hw) | ||||
{ | { | ||||
struct e1000_phy_info *phy = &hw->phy; | struct e1000_phy_info *phy = &hw->phy; | ||||
s32 ret_val = E1000_SUCCESS; | s32 ret_val; | ||||
phy->addr = 1; | phy->addr = 1; | ||||
phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; | ||||
phy->reset_delay_us = 10000; | phy->reset_delay_us = 10000; | ||||
phy->type = e1000_phy_m88; | phy->type = e1000_phy_m88; | ||||
/* Function Pointers */ | /* Function Pointers */ | ||||
phy->ops.check_polarity = e1000_check_polarity_m88; | phy->ops.check_polarity = e1000_check_polarity_m88; | ||||
▲ Show 20 Lines • Show All 246 Lines • ▼ Show 20 Lines | |||||
* @hw: pointer to the HW structure | * @hw: pointer to the HW structure | ||||
* | * | ||||
* This inits the hardware readying it for operation. | * This inits the hardware readying it for operation. | ||||
**/ | **/ | ||||
static s32 e1000_init_hw_82540(struct e1000_hw *hw) | static s32 e1000_init_hw_82540(struct e1000_hw *hw) | ||||
{ | { | ||||
struct e1000_mac_info *mac = &hw->mac; | struct e1000_mac_info *mac = &hw->mac; | ||||
u32 txdctl, ctrl_ext; | u32 txdctl, ctrl_ext; | ||||
s32 ret_val = E1000_SUCCESS; | s32 ret_val; | ||||
u16 i; | u16 i; | ||||
DEBUGFUNC("e1000_init_hw_82540"); | DEBUGFUNC("e1000_init_hw_82540"); | ||||
/* Initialize identification LED */ | /* Initialize identification LED */ | ||||
ret_val = mac->ops.id_led_init(hw); | ret_val = mac->ops.id_led_init(hw); | ||||
if (ret_val) { | if (ret_val) { | ||||
DEBUGOUT("Error initializing identification LED\n"); | DEBUGOUT("Error initializing identification LED\n"); | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | |||||
* Calls the appropriate function to configure the link for auto-neg or forced | * Calls the appropriate function to configure the link for auto-neg or forced | ||||
* speed and duplex. Then we check for link, once link is established calls | * speed and duplex. Then we check for link, once link is established calls | ||||
* to configure collision distance and flow control are called. If link is | * to configure collision distance and flow control are called. If link is | ||||
* not established, we return -E1000_ERR_PHY (-2). | * not established, we return -E1000_ERR_PHY (-2). | ||||
**/ | **/ | ||||
static s32 e1000_setup_copper_link_82540(struct e1000_hw *hw) | static s32 e1000_setup_copper_link_82540(struct e1000_hw *hw) | ||||
{ | { | ||||
u32 ctrl; | u32 ctrl; | ||||
s32 ret_val = E1000_SUCCESS; | s32 ret_val; | ||||
u16 data; | u16 data; | ||||
DEBUGFUNC("e1000_setup_copper_link_82540"); | DEBUGFUNC("e1000_setup_copper_link_82540"); | ||||
ctrl = E1000_READ_REG(hw, E1000_CTRL); | ctrl = E1000_READ_REG(hw, E1000_CTRL); | ||||
ctrl |= E1000_CTRL_SLU; | ctrl |= E1000_CTRL_SLU; | ||||
ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); | ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); | ||||
E1000_WRITE_REG(hw, E1000_CTRL, ctrl); | E1000_WRITE_REG(hw, E1000_CTRL, ctrl); | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* e1000_adjust_serdes_amplitude_82540 - Adjust amplitude based on EEPROM | * e1000_adjust_serdes_amplitude_82540 - Adjust amplitude based on EEPROM | ||||
* @hw: pointer to the HW structure | * @hw: pointer to the HW structure | ||||
* | * | ||||
* Adjust the SERDES output amplitude based on the EEPROM settings. | * Adjust the SERDES output amplitude based on the EEPROM settings. | ||||
**/ | **/ | ||||
static s32 e1000_adjust_serdes_amplitude_82540(struct e1000_hw *hw) | static s32 e1000_adjust_serdes_amplitude_82540(struct e1000_hw *hw) | ||||
{ | { | ||||
s32 ret_val = E1000_SUCCESS; | s32 ret_val; | ||||
u16 nvm_data; | u16 nvm_data; | ||||
DEBUGFUNC("e1000_adjust_serdes_amplitude_82540"); | DEBUGFUNC("e1000_adjust_serdes_amplitude_82540"); | ||||
ret_val = hw->nvm.ops.read(hw, NVM_SERDES_AMPLITUDE, 1, &nvm_data); | ret_val = hw->nvm.ops.read(hw, NVM_SERDES_AMPLITUDE, 1, &nvm_data); | ||||
if (ret_val) | if (ret_val) | ||||
goto out; | goto out; | ||||
Show All 13 Lines | |||||
/** | /** | ||||
* e1000_set_vco_speed_82540 - Set VCO speed for better performance | * e1000_set_vco_speed_82540 - Set VCO speed for better performance | ||||
* @hw: pointer to the HW structure | * @hw: pointer to the HW structure | ||||
* | * | ||||
* Set the VCO speed to improve Bit Error Rate (BER) performance. | * Set the VCO speed to improve Bit Error Rate (BER) performance. | ||||
**/ | **/ | ||||
static s32 e1000_set_vco_speed_82540(struct e1000_hw *hw) | static s32 e1000_set_vco_speed_82540(struct e1000_hw *hw) | ||||
{ | { | ||||
s32 ret_val = E1000_SUCCESS; | s32 ret_val; | ||||
u16 default_page = 0; | u16 default_page = 0; | ||||
u16 phy_data; | u16 phy_data; | ||||
DEBUGFUNC("e1000_set_vco_speed_82540"); | DEBUGFUNC("e1000_set_vco_speed_82540"); | ||||
/* Set PHY register 30, page 5, bit 8 to 0 */ | /* Set PHY register 30, page 5, bit 8 to 0 */ | ||||
ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_PAGE_SELECT, | ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_PAGE_SELECT, | ||||
▲ Show 20 Lines • Show All 179 Lines • Show Last 20 Lines |