1 /****************************************************************************** 2 3 Copyright (c) 2001-2012, Intel Corporation 4 All rights reserved. 5 6 Redistribution and use in source and binary forms, with or without 7 modification, are permitted provided that the following conditions are met: 8 9 1. Redistributions of source code must retain the above copyright notice, 10 this list of conditions and the following disclaimer. 11 12 2. Redistributions in binary form must reproduce the above copyright 13 notice, this list of conditions and the following disclaimer in the 14 documentation and/or other materials provided with the distribution. 15 16 3. Neither the name of the Intel Corporation nor the names of its 17 contributors may be used to endorse or promote products derived from 18 this software without specific prior written permission. 19 20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 POSSIBILITY OF SUCH DAMAGE. 31 32 ******************************************************************************/ 33 /*$FreeBSD$*/ 34 35 #ifndef _E1000_I210_H_ 36 #define _E1000_I210_H_ 37 38 s32 e1000_update_flash_i210(struct e1000_hw *hw); 39 s32 e1000_update_nvm_checksum_i210(struct e1000_hw *hw); 40 s32 e1000_validate_nvm_checksum_i210(struct e1000_hw *hw); 41 s32 e1000_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, 42 u16 words, u16 *data); 43 s32 e1000_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, 44 u16 words, u16 *data); 45 s32 e1000_read_invm_i211(struct e1000_hw *hw, u8 address, u16 *data); 46 s32 e1000_check_for_copper_link_i210(struct e1000_hw *hw); 47 s32 e1000_set_ltr_i210(struct e1000_hw *hw, bool link); 48 s32 e1000_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask); 49 void e1000_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask); 50 51 #define E1000_STM_OPCODE 0xDB00 52 #define E1000_EEPROM_FLASH_SIZE_WORD 0x11 53 54 #define INVM_DWORD_TO_RECORD_TYPE(invm_dword) \ 55 (u8)((invm_dword) & 0x7) 56 #define INVM_DWORD_TO_WORD_ADDRESS(invm_dword) \ 57 (u8)(((invm_dword) & 0x0000FE00) >> 9) 58 #define INVM_DWORD_TO_WORD_DATA(invm_dword) \ 59 (u16)(((invm_dword) & 0xFFFF0000) >> 16) 60 61 enum E1000_INVM_STRUCTURE_TYPE { 62 E1000_INVM_UNINITIALIZED_STRUCTURE = 0x00, 63 E1000_INVM_WORD_AUTOLOAD_STRUCTURE = 0x01, 64 E1000_INVM_CSR_AUTOLOAD_STRUCTURE = 0x02, 65 E1000_INVM_PHY_REGISTER_AUTOLOAD_STRUCTURE = 0x03, 66 E1000_INVM_RSA_KEY_SHA256_STRUCTURE = 0x04, 67 E1000_INVM_INVALIDATED_STRUCTURE = 0x0F, 68 }; 69 70 #define E1000_INVM_RSA_KEY_SHA256_DATA_SIZE_IN_DWORDS 8 71 #define E1000_INVM_CSR_AUTOLOAD_DATA_SIZE_IN_DWORDS 1 72 73 #define ID_LED_DEFAULT_I210 ((ID_LED_OFF1_ON2 << 8) | \ 74 (ID_LED_DEF1_DEF2 << 4) | \ 75 (ID_LED_OFF1_OFF2)) 76 #define ID_LED_DEFAULT_I210_SERDES ((ID_LED_DEF1_DEF2 << 8) | \ 77 (ID_LED_DEF1_DEF2 << 4) | \ 78 (ID_LED_DEF1_DEF2)) 79 80 #endif 81