e1000_i210.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Intel(R) Gigabit Ethernet Linux driver
  3. * Copyright(c) 2007-2014 Intel Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, see <http://www.gnu.org/licenses/>.
  16. *
  17. * The full GNU General Public License is included in this distribution in
  18. * the file called "COPYING".
  19. *
  20. * Contact Information:
  21. * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  22. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  23. */
  24. #ifndef _E1000_I210_H_
  25. #define _E1000_I210_H_
  26. s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
  27. void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
  28. s32 igb_valid_led_default_i210(struct e1000_hw *hw, u16 *data);
  29. s32 igb_read_invm_version(struct e1000_hw *hw,
  30. struct e1000_fw_version *invm_ver);
  31. s32 igb_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data);
  32. s32 igb_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data);
  33. s32 igb_init_nvm_params_i210(struct e1000_hw *hw);
  34. bool igb_get_flash_presence_i210(struct e1000_hw *hw);
  35. s32 igb_pll_workaround_i210(struct e1000_hw *hw);
  36. s32 igb_get_cfg_done_i210(struct e1000_hw *hw);
  37. #define E1000_STM_OPCODE 0xDB00
  38. #define E1000_EEPROM_FLASH_SIZE_WORD 0x11
  39. #define INVM_DWORD_TO_RECORD_TYPE(invm_dword) \
  40. (u8)((invm_dword) & 0x7)
  41. #define INVM_DWORD_TO_WORD_ADDRESS(invm_dword) \
  42. (u8)(((invm_dword) & 0x0000FE00) >> 9)
  43. #define INVM_DWORD_TO_WORD_DATA(invm_dword) \
  44. (u16)(((invm_dword) & 0xFFFF0000) >> 16)
  45. enum E1000_INVM_STRUCTURE_TYPE {
  46. E1000_INVM_UNINITIALIZED_STRUCTURE = 0x00,
  47. E1000_INVM_WORD_AUTOLOAD_STRUCTURE = 0x01,
  48. E1000_INVM_CSR_AUTOLOAD_STRUCTURE = 0x02,
  49. E1000_INVM_PHY_REGISTER_AUTOLOAD_STRUCTURE = 0x03,
  50. E1000_INVM_RSA_KEY_SHA256_STRUCTURE = 0x04,
  51. E1000_INVM_INVALIDATED_STRUCTURE = 0x0F,
  52. };
  53. #define E1000_INVM_RSA_KEY_SHA256_DATA_SIZE_IN_DWORDS 8
  54. #define E1000_INVM_CSR_AUTOLOAD_DATA_SIZE_IN_DWORDS 1
  55. #define E1000_INVM_ULT_BYTES_SIZE 8
  56. #define E1000_INVM_RECORD_SIZE_IN_BYTES 4
  57. #define E1000_INVM_VER_FIELD_ONE 0x1FF8
  58. #define E1000_INVM_VER_FIELD_TWO 0x7FE000
  59. #define E1000_INVM_IMGTYPE_FIELD 0x1F800000
  60. #define E1000_INVM_MAJOR_MASK 0x3F0
  61. #define E1000_INVM_MINOR_MASK 0xF
  62. #define E1000_INVM_MAJOR_SHIFT 4
  63. #define ID_LED_DEFAULT_I210 ((ID_LED_OFF1_ON2 << 8) | \
  64. (ID_LED_DEF1_DEF2 << 4) | \
  65. (ID_LED_OFF1_OFF2))
  66. #define ID_LED_DEFAULT_I210_SERDES ((ID_LED_DEF1_DEF2 << 8) | \
  67. (ID_LED_DEF1_DEF2 << 4) | \
  68. (ID_LED_OFF1_ON2))
  69. /* NVM offset defaults for i211 device */
  70. #define NVM_INIT_CTRL_2_DEFAULT_I211 0X7243
  71. #define NVM_INIT_CTRL_4_DEFAULT_I211 0x00C1
  72. #define NVM_LED_1_CFG_DEFAULT_I211 0x0184
  73. #define NVM_LED_0_2_CFG_DEFAULT_I211 0x200C
  74. /* PLL Defines */
  75. #define E1000_PCI_PMCSR 0x44
  76. #define E1000_PCI_PMCSR_D3 0x03
  77. #define E1000_MAX_PLL_TRIES 5
  78. #define E1000_PHY_PLL_UNCONF 0xFF
  79. #define E1000_PHY_PLL_FREQ_PAGE 0xFC
  80. #define E1000_PHY_PLL_FREQ_REG 0x000E
  81. #define E1000_INVM_DEFAULT_AL 0x202F
  82. #define E1000_INVM_AUTOLOAD 0x0A
  83. #define E1000_INVM_PLL_WO_VAL 0x0010
  84. #endif