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