e1000_nvm.h revision 256281
1254219Scy/******************************************************************************
2254219Scy
3254219Scy  Copyright (c) 2001-2013, Intel Corporation
4254219Scy  All rights reserved.
5254219Scy
6254219Scy  Redistribution and use in source and binary forms, with or without
7254219Scy  modification, are permitted provided that the following conditions are met:
8254219Scy
9254219Scy   1. Redistributions of source code must retain the above copyright notice,
10254219Scy      this list of conditions and the following disclaimer.
11254219Scy
12254219Scy   2. Redistributions in binary form must reproduce the above copyright
13254219Scy      notice, this list of conditions and the following disclaimer in the
14254219Scy      documentation and/or other materials provided with the distribution.
15254219Scy
16254219Scy   3. Neither the name of the Intel Corporation nor the names of its
17254219Scy      contributors may be used to endorse or promote products derived from
18254219Scy      this software without specific prior written permission.
19254219Scy
20254219Scy  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21254219Scy  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22254219Scy  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23254219Scy  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24254219Scy  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25254219Scy  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26254219Scy  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27254219Scy  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28254219Scy  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29254219Scy  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30254219Scy  POSSIBILITY OF SUCH DAMAGE.
31254219Scy
32254219Scy******************************************************************************/
33254219Scy/*$FreeBSD: stable/10/sys/dev/e1000/e1000_nvm.h 247064 2013-02-21 00:25:45Z jfv $*/
34254219Scy
35254219Scy#ifndef _E1000_NVM_H_
36254219Scy#define _E1000_NVM_H_
37254219Scy
38254219Scy#if !defined(NO_READ_PBA_RAW) || !defined(NO_WRITE_PBA_RAW)
39254219Scystruct e1000_pba {
40254219Scy	u16 word[2];
41254219Scy	u16 *pba_block;
42254219Scy};
43254219Scy#endif
44254219Scy
45254219Scy
46254219Scyvoid e1000_init_nvm_ops_generic(struct e1000_hw *hw);
47254219Scys32  e1000_null_read_nvm(struct e1000_hw *hw, u16 a, u16 b, u16 *c);
48254219Scyvoid e1000_null_nvm_generic(struct e1000_hw *hw);
49254219Scys32  e1000_null_led_default(struct e1000_hw *hw, u16 *data);
50254219Scys32  e1000_null_write_nvm(struct e1000_hw *hw, u16 a, u16 b, u16 *c);
51254219Scys32  e1000_acquire_nvm_generic(struct e1000_hw *hw);
52254219Scy
53254219Scys32  e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
54254219Scys32  e1000_read_mac_addr_generic(struct e1000_hw *hw);
55254219Scys32  e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num,
56254219Scy				   u32 pba_num_size);
57254219Scys32  e1000_read_pba_length_generic(struct e1000_hw *hw, u32 *pba_num_size);
58254219Scys32 e1000_read_pba_raw(struct e1000_hw *hw, u16 *eeprom_buf,
59254219Scy		       u32 eeprom_buf_size, u16 max_pba_block_size,
60254219Scy		       struct e1000_pba *pba);
61254219Scys32 e1000_write_pba_raw(struct e1000_hw *hw, u16 *eeprom_buf,
62254219Scy			u32 eeprom_buf_size, struct e1000_pba *pba);
63254219Scys32 e1000_get_pba_block_size(struct e1000_hw *hw, u16 *eeprom_buf,
64254219Scy			     u32 eeprom_buf_size, u16 *pba_block_size);
65254219Scys32  e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
66254219Scys32  e1000_read_nvm_microwire(struct e1000_hw *hw, u16 offset,
67254219Scy			      u16 words, u16 *data);
68254219Scys32  e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words,
69254219Scy			 u16 *data);
70254219Scys32  e1000_valid_led_default_generic(struct e1000_hw *hw, u16 *data);
71254219Scys32  e1000_validate_nvm_checksum_generic(struct e1000_hw *hw);
72254219Scys32  e1000_write_nvm_microwire(struct e1000_hw *hw, u16 offset,
73254219Scy			       u16 words, u16 *data);
74254219Scys32  e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words,
75254219Scy			 u16 *data);
76254219Scys32  e1000_update_nvm_checksum_generic(struct e1000_hw *hw);
77254219Scyvoid e1000_stop_nvm(struct e1000_hw *hw);
78254219Scyvoid e1000_release_nvm_generic(struct e1000_hw *hw);
79254219Scy
80254219Scy#define E1000_STM_OPCODE	0xDB00
81254219Scy
82254219Scy#endif
83254219Scy