linux/drivers/net/ethernet/intel/e1000e/ich8lan.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright(c) 1999 - 2018 Intel Corporation. */

#ifndef _E1000E_ICH8LAN_H_
#define _E1000E_ICH8LAN_H_

#define ICH_FLASH_GFPREG
#define ICH_FLASH_HSFSTS
#define ICH_FLASH_HSFCTL
#define ICH_FLASH_FADDR
#define ICH_FLASH_FDATA0
#define ICH_FLASH_PR0

/* Requires up to 10 seconds when MNG might be accessing part. */
#define ICH_FLASH_READ_COMMAND_TIMEOUT
#define ICH_FLASH_WRITE_COMMAND_TIMEOUT
#define ICH_FLASH_ERASE_COMMAND_TIMEOUT
#define ICH_FLASH_LINEAR_ADDR_MASK
#define ICH_FLASH_CYCLE_REPEAT_COUNT

#define ICH_CYCLE_READ
#define ICH_CYCLE_WRITE
#define ICH_CYCLE_ERASE

#define FLASH_GFPREG_BASE_MASK
#define FLASH_SECTOR_ADDR_SHIFT

#define ICH_FLASH_SEG_SIZE_256
#define ICH_FLASH_SEG_SIZE_4K
#define ICH_FLASH_SEG_SIZE_8K
#define ICH_FLASH_SEG_SIZE_64K

#define E1000_ICH_FWSM_RSPCIPHY
/* FW established a valid mode */
#define E1000_ICH_FWSM_FW_VALID
#define E1000_ICH_FWSM_PCIM2PCI
#define E1000_ICH_FWSM_PCIM2PCI_COUNT

#define E1000_ICH_MNG_IAMT_MODE

#define E1000_FWSM_WLOCK_MAC_MASK
#define E1000_FWSM_WLOCK_MAC_SHIFT
#define E1000_FWSM_ULP_CFG_DONE
#define E1000_EXFWSM_DPG_EXIT_DONE

/* Shared Receive Address Registers */
#define E1000_SHRAL_PCH_LPT(_i)
#define E1000_SHRAH_PCH_LPT(_i)

#define E1000_H2ME
#define E1000_H2ME_START_DPG
#define E1000_H2ME_EXIT_DPG
#define E1000_H2ME_ULP
#define E1000_H2ME_ENFORCE_SETTINGS

#define ID_LED_DEFAULT_ICH8LAN

#define E1000_ICH_NVM_SIG_WORD
#define E1000_ICH_NVM_SIG_MASK
#define E1000_ICH_NVM_VALID_SIG_MASK
#define E1000_ICH_NVM_SIG_VALUE

#define E1000_ICH8_LAN_INIT_TIMEOUT

/* FEXT register bit definition */
#define E1000_FEXT_PHY_CABLE_DISCONNECTED

#define E1000_FEXTNVM_SW_CONFIG
#define E1000_FEXTNVM_SW_CONFIG_ICH8M

#define E1000_FEXTNVM3_PHY_CFG_COUNTER_MASK
#define E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC

#define E1000_FEXTNVM4_BEACON_DURATION_MASK
#define E1000_FEXTNVM4_BEACON_DURATION_8USEC
#define E1000_FEXTNVM4_BEACON_DURATION_16USEC

#define E1000_FEXTNVM6_REQ_PLL_CLK
#define E1000_FEXTNVM6_ENABLE_K1_ENTRY_CONDITION
#define E1000_FEXTNVM6_K1_OFF_ENABLE
/* bit for disabling packet buffer read */
#define E1000_FEXTNVM7_DISABLE_PB_READ
#define E1000_FEXTNVM7_SIDE_CLK_UNGATE
#define E1000_FEXTNVM7_DISABLE_SMB_PERST
#define E1000_FEXTNVM9_IOSFSB_CLKGATE_DIS
#define E1000_FEXTNVM9_IOSFSB_CLKREQ_DIS
#define E1000_FEXTNVM11_DISABLE_PB_READ
#define E1000_FEXTNVM11_DISABLE_MULR_FIX

/* bit24: RXDCTL thresholds granularity: 0 - cache lines, 1 - descriptors */
#define E1000_RXDCTL_THRESH_UNIT_DESC

#define K1_ENTRY_LATENCY
#define K1_MIN_TIME
#define NVM_SIZE_MULTIPLIER
#define E1000_FLASH_BASE_ADDR
#define E1000_CTRL_EXT_NVMVS
#define E1000_TARC0_CB_MULTIQ_3_REQ
#define E1000_TARC0_CB_MULTIQ_2_REQ
#define PCIE_ICH8_SNOOP_ALL

#define E1000_ICH_RAR_ENTRIES
#define E1000_PCH2_RAR_ENTRIES
#define E1000_PCH_LPT_RAR_ENTRIES

#define PHY_PAGE_SHIFT
#define PHY_REG(page, reg)
#define IGP3_KMRN_DIAG
#define IGP3_VR_CTRL

#define IGP3_KMRN_DIAG_PCS_LOCK_LOSS
#define IGP3_VR_CTRL_DEV_POWERDOWN_MODE_MASK
#define IGP3_VR_CTRL_MODE_SHUTDOWN

/* PHY Wakeup Registers and defines */
#define BM_PORT_GEN_CFG
#define BM_RCTL
#define BM_WUC
#define BM_WUFC
#define BM_WUS
#define BM_RAR_L(_i)
#define BM_RAR_M(_i)
#define BM_RAR_H(_i)
#define BM_RAR_CTRL(_i)
#define BM_MTA(_i)

#define BM_RCTL_UPE
#define BM_RCTL_MPE
#define BM_RCTL_MO_SHIFT
#define BM_RCTL_MO_MASK
#define BM_RCTL_BAM
#define BM_RCTL_PMCF
#define BM_RCTL_RFCE

#define HV_LED_CONFIG
#define HV_MUX_DATA_CTRL
#define HV_MUX_DATA_CTRL_GEN_TO_MAC
#define HV_MUX_DATA_CTRL_FORCE_SPEED
#define HV_STATS_PAGE
/* Half-duplex collision counts */
#define HV_SCC_UPPER
#define HV_SCC_LOWER
#define HV_ECOL_UPPER
#define HV_ECOL_LOWER
#define HV_MCC_UPPER
#define HV_MCC_LOWER
#define HV_LATECOL_UPPER
#define HV_LATECOL_LOWER
#define HV_COLC_UPPER
#define HV_COLC_LOWER
#define HV_DC_UPPER
#define HV_DC_LOWER
#define HV_TNCRS_UPPER
#define HV_TNCRS_LOWER

#define E1000_FCRTV_PCH

#define E1000_NVM_K1_CONFIG
#define E1000_NVM_K1_ENABLE

/* SMBus Control Phy Register */
#define CV_SMB_CTRL
#define CV_SMB_CTRL_FORCE_SMBUS

/* I218 Ultra Low Power Configuration 1 Register */
#define I218_ULP_CONFIG1
#define I218_ULP_CONFIG1_START
#define I218_ULP_CONFIG1_IND
#define I218_ULP_CONFIG1_STICKY_ULP
#define I218_ULP_CONFIG1_INBAND_EXIT
#define I218_ULP_CONFIG1_WOL_HOST
#define I218_ULP_CONFIG1_RESET_TO_SMBUS
/* enable ULP even if when phy powered down via lanphypc */
#define I218_ULP_CONFIG1_EN_ULP_LANPHYPC
/* disable clear of sticky ULP on PERST */
#define I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST
#define I218_ULP_CONFIG1_DISABLE_SMB_PERST

/* SMBus Address Phy Register */
#define HV_SMB_ADDR
#define HV_SMB_ADDR_MASK
#define HV_SMB_ADDR_PEC_EN
#define HV_SMB_ADDR_VALID
#define HV_SMB_ADDR_FREQ_MASK
#define HV_SMB_ADDR_FREQ_LOW_SHIFT
#define HV_SMB_ADDR_FREQ_HIGH_SHIFT

/* Strapping Option Register - RO */
#define E1000_STRAP
#define E1000_STRAP_SMBUS_ADDRESS_MASK
#define E1000_STRAP_SMBUS_ADDRESS_SHIFT
#define E1000_STRAP_SMT_FREQ_MASK
#define E1000_STRAP_SMT_FREQ_SHIFT

/* OEM Bits Phy Register */
#define HV_OEM_BITS
#define HV_OEM_BITS_LPLU
#define HV_OEM_BITS_GBE_DIS
#define HV_OEM_BITS_RESTART_AN

/* KMRN Mode Control */
#define HV_KMRN_MODE_CTRL
#define HV_KMRN_MDIO_SLOW

/* KMRN FIFO Control and Status */
#define HV_KMRN_FIFO_CTRLSTA
#define HV_KMRN_FIFO_CTRLSTA_PREAMBLE_MASK
#define HV_KMRN_FIFO_CTRLSTA_PREAMBLE_SHIFT

/* PHY Power Management Control */
#define HV_PM_CTRL
#define HV_PM_CTRL_K1_CLK_REQ
#define HV_PM_CTRL_K1_ENABLE

#define I217_PLL_CLOCK_GATE_REG
#define I217_PLL_CLOCK_GATE_MASK

#define SW_FLAG_TIMEOUT

/* Inband Control */
#define I217_INBAND_CTRL
#define I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_MASK
#define I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_SHIFT

/* Low Power Idle GPIO Control */
#define I217_LPI_GPIO_CTRL
#define I217_LPI_GPIO_CTRL_AUTO_EN_LPI

/* PHY Low Power Idle Control */
#define I82579_LPI_CTRL
#define I82579_LPI_CTRL_100_ENABLE
#define I82579_LPI_CTRL_1000_ENABLE
#define I82579_LPI_CTRL_ENABLE_MASK
#define I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT

/* Extended Management Interface (EMI) Registers */
#define I82579_EMI_ADDR
#define I82579_EMI_DATA
#define I82579_LPI_UPDATE_TIMER
#define I82579_MSE_THRESHOLD
#define I82577_MSE_THRESHOLD
#define I82579_MSE_LINK_DOWN
#define I82579_RX_CONFIG
#define I82579_LPI_PLL_SHUT
#define I82579_EEE_PCS_STATUS
#define I82579_EEE_CAPABILITY
#define I82579_EEE_ADVERTISEMENT
#define I82579_EEE_LP_ABILITY
#define I82579_EEE_100_SUPPORTED
#define I82579_EEE_1000_SUPPORTED
#define I82579_LPI_100_PLL_SHUT
#define I217_EEE_PCS_STATUS
#define I217_EEE_CAPABILITY
#define I217_EEE_ADVERTISEMENT
#define I217_EEE_LP_ABILITY
#define I217_RX_CONFIG

#define E1000_EEE_RX_LPI_RCVD
#define E1000_EEE_TX_LPI_RCVD

/* Intel Rapid Start Technology Support */
#define I217_PROXY_CTRL
#define I217_PROXY_CTRL_AUTO_DISABLE
#define I217_SxCTRL
#define I217_SxCTRL_ENABLE_LPI_RESET
#define I217_CGFREG
#define I217_CGFREG_ENABLE_MTA_RESET
#define I217_MEMPWR
#define I217_MEMPWR_DISABLE_SMB_RELEASE

/* Receive Address Initial CRC Calculation */
#define E1000_PCH_RAICC(_n)

/* Latency Tolerance Reporting */
#define E1000_LTRV
#define E1000_LTRV_VALUE_MASK
#define E1000_LTRV_SCALE_MAX
#define E1000_LTRV_SCALE_FACTOR
#define E1000_LTRV_SCALE_SHIFT
#define E1000_LTRV_SCALE_MASK
#define E1000_LTRV_REQ_SHIFT
#define E1000_LTRV_NOSNOOP_SHIFT
#define E1000_LTRV_SEND

/* Proprietary Latency Tolerance Reporting PCI Capability */
#define E1000_PCI_LTR_CAP_LPT

/* Don't gate wake DMA clock */
#define E1000_FFLT_DBG_DONT_GATE_WAKE_DMA_CLK

void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw);
void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
						  bool state);
void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw);
void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw);
void e1000_resume_workarounds_pchlan(struct e1000_hw *hw);
s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable);
void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw);
s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable);
s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data);
s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data);
s32 e1000_set_eee_pchlan(struct e1000_hw *hw);
s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx);
#endif /* _E1000E_ICH8LAN_H_ */