blob: 2d913716573a29a830610de841164e30e505cdfb [file] [log] [blame]
Carolyn Wybornyf96a8a02012-04-06 23:25:19 +00001/*******************************************************************************
2
3 Intel(R) Gigabit Ethernet Linux driver
Akeem G. Abodunrin4b9ea462013-01-08 18:31:12 +00004 Copyright(c) 2007-2013 Intel Corporation.
Carolyn Wybornyf96a8a02012-04-06 23:25:19 +00005
6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License,
8 version 2, as published by the Free Software Foundation.
9
10 This program is distributed in the hope it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 more details.
14
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18
19 The full GNU General Public License is included in this distribution in
20 the file called "COPYING".
21
22 Contact Information:
23 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
24 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
25
26*******************************************************************************/
27
28#ifndef _E1000_I210_H_
29#define _E1000_I210_H_
30
Joe Perches5ccc9212013-09-23 11:37:59 -070031s32 igb_update_flash_i210(struct e1000_hw *hw);
32s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw);
33s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw);
34s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words,
35 u16 *data);
36s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words,
37 u16 *data);
38s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
39void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
40s32 igb_acquire_nvm_i210(struct e1000_hw *hw);
41void igb_release_nvm_i210(struct e1000_hw *hw);
42s32 igb_valid_led_default_i210(struct e1000_hw *hw, u16 *data);
43s32 igb_read_invm_version(struct e1000_hw *hw,
44 struct e1000_fw_version *invm_ver);
45s32 igb_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data);
46s32 igb_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data);
47s32 igb_init_nvm_params_i210(struct e1000_hw *hw);
48bool igb_get_flash_presence_i210(struct e1000_hw *hw);
Carolyn Wybornyf96a8a02012-04-06 23:25:19 +000049
50#define E1000_STM_OPCODE 0xDB00
51#define E1000_EEPROM_FLASH_SIZE_WORD 0x11
52
53#define INVM_DWORD_TO_RECORD_TYPE(invm_dword) \
54 (u8)((invm_dword) & 0x7)
55#define INVM_DWORD_TO_WORD_ADDRESS(invm_dword) \
56 (u8)(((invm_dword) & 0x0000FE00) >> 9)
57#define INVM_DWORD_TO_WORD_DATA(invm_dword) \
58 (u16)(((invm_dword) & 0xFFFF0000) >> 16)
59
60enum E1000_INVM_STRUCTURE_TYPE {
61 E1000_INVM_UNINITIALIZED_STRUCTURE = 0x00,
62 E1000_INVM_WORD_AUTOLOAD_STRUCTURE = 0x01,
63 E1000_INVM_CSR_AUTOLOAD_STRUCTURE = 0x02,
64 E1000_INVM_PHY_REGISTER_AUTOLOAD_STRUCTURE = 0x03,
65 E1000_INVM_RSA_KEY_SHA256_STRUCTURE = 0x04,
66 E1000_INVM_INVALIDATED_STRUCTURE = 0x0F,
67};
68
69#define E1000_INVM_RSA_KEY_SHA256_DATA_SIZE_IN_DWORDS 8
70#define E1000_INVM_CSR_AUTOLOAD_DATA_SIZE_IN_DWORDS 1
Carolyn Wyborny09e77282012-10-23 13:04:37 +000071#define E1000_INVM_ULT_BYTES_SIZE 8
72#define E1000_INVM_RECORD_SIZE_IN_BYTES 4
73#define E1000_INVM_VER_FIELD_ONE 0x1FF8
74#define E1000_INVM_VER_FIELD_TWO 0x7FE000
75#define E1000_INVM_IMGTYPE_FIELD 0x1F800000
76
77#define E1000_INVM_MAJOR_MASK 0x3F0
78#define E1000_INVM_MINOR_MASK 0xF
79#define E1000_INVM_MAJOR_SHIFT 4
Carolyn Wybornyf96a8a02012-04-06 23:25:19 +000080
81#define ID_LED_DEFAULT_I210 ((ID_LED_OFF1_ON2 << 8) | \
Akeem G. Abodunrin6f8b9162013-05-01 05:44:45 +000082 (ID_LED_DEF1_DEF2 << 4) | \
83 (ID_LED_OFF1_OFF2))
Carolyn Wybornyf96a8a02012-04-06 23:25:19 +000084#define ID_LED_DEFAULT_I210_SERDES ((ID_LED_DEF1_DEF2 << 8) | \
85 (ID_LED_DEF1_DEF2 << 4) | \
Akeem G. Abodunrin6f8b9162013-05-01 05:44:45 +000086 (ID_LED_OFF1_ON2))
Carolyn Wybornyf96a8a02012-04-06 23:25:19 +000087
Carolyn Wyborny1720ee32012-10-11 02:15:45 +000088/* NVM offset defaults for i211 device */
89#define NVM_INIT_CTRL_2_DEFAULT_I211 0X7243
90#define NVM_INIT_CTRL_4_DEFAULT_I211 0x00C1
91#define NVM_LED_1_CFG_DEFAULT_I211 0x0184
92#define NVM_LED_0_2_CFG_DEFAULT_I211 0x200C
93
Carolyn Wybornyf96a8a02012-04-06 23:25:19 +000094#endif