xref: /dflybsd-src/sys/dev/netif/ig_hal/e1000_82541.h (revision 01a55482b42bba8de64caeb8c9ede647a9208734)
19c80d176SSepherosa Ziehau /******************************************************************************
29c80d176SSepherosa Ziehau 
3*01a55482SSepherosa Ziehau   Copyright (c) 2001-2019, Intel Corporation
49c80d176SSepherosa Ziehau   All rights reserved.
59c80d176SSepherosa Ziehau 
69c80d176SSepherosa Ziehau   Redistribution and use in source and binary forms, with or without
79c80d176SSepherosa Ziehau   modification, are permitted provided that the following conditions are met:
89c80d176SSepherosa Ziehau 
99c80d176SSepherosa Ziehau    1. Redistributions of source code must retain the above copyright notice,
109c80d176SSepherosa Ziehau       this list of conditions and the following disclaimer.
119c80d176SSepherosa Ziehau 
129c80d176SSepherosa Ziehau    2. Redistributions in binary form must reproduce the above copyright
139c80d176SSepherosa Ziehau       notice, this list of conditions and the following disclaimer in the
149c80d176SSepherosa Ziehau       documentation and/or other materials provided with the distribution.
159c80d176SSepherosa Ziehau 
169c80d176SSepherosa Ziehau    3. Neither the name of the Intel Corporation nor the names of its
179c80d176SSepherosa Ziehau       contributors may be used to endorse or promote products derived from
189c80d176SSepherosa Ziehau       this software without specific prior written permission.
199c80d176SSepherosa Ziehau 
209c80d176SSepherosa Ziehau   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
219c80d176SSepherosa Ziehau   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
229c80d176SSepherosa Ziehau   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
239c80d176SSepherosa Ziehau   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
249c80d176SSepherosa Ziehau   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
259c80d176SSepherosa Ziehau   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
269c80d176SSepherosa Ziehau   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
279c80d176SSepherosa Ziehau   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
289c80d176SSepherosa Ziehau   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
299c80d176SSepherosa Ziehau   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
309c80d176SSepherosa Ziehau   POSSIBILITY OF SUCH DAMAGE.
319c80d176SSepherosa Ziehau 
329c80d176SSepherosa Ziehau ******************************************************************************/
3374dc3754SSepherosa Ziehau /*$FreeBSD$*/
349c80d176SSepherosa Ziehau 
359c80d176SSepherosa Ziehau #ifndef _E1000_82541_H_
369c80d176SSepherosa Ziehau #define _E1000_82541_H_
379c80d176SSepherosa Ziehau 
389c80d176SSepherosa Ziehau #define NVM_WORD_SIZE_BASE_SHIFT_82541 (NVM_WORD_SIZE_BASE_SHIFT + 1)
399c80d176SSepherosa Ziehau 
409c80d176SSepherosa Ziehau #define IGP01E1000_PHY_CHANNEL_NUM		4
419c80d176SSepherosa Ziehau 
429c80d176SSepherosa Ziehau #define IGP01E1000_PHY_AGC_A			0x1172
439c80d176SSepherosa Ziehau #define IGP01E1000_PHY_AGC_B			0x1272
449c80d176SSepherosa Ziehau #define IGP01E1000_PHY_AGC_C			0x1472
459c80d176SSepherosa Ziehau #define IGP01E1000_PHY_AGC_D			0x1872
469c80d176SSepherosa Ziehau 
479c80d176SSepherosa Ziehau #define IGP01E1000_PHY_AGC_PARAM_A		0x1171
489c80d176SSepherosa Ziehau #define IGP01E1000_PHY_AGC_PARAM_B		0x1271
499c80d176SSepherosa Ziehau #define IGP01E1000_PHY_AGC_PARAM_C		0x1471
509c80d176SSepherosa Ziehau #define IGP01E1000_PHY_AGC_PARAM_D		0x1871
519c80d176SSepherosa Ziehau 
529c80d176SSepherosa Ziehau #define IGP01E1000_PHY_EDAC_MU_INDEX		0xC000
539c80d176SSepherosa Ziehau #define IGP01E1000_PHY_EDAC_SIGN_EXT_9_BITS	0x8000
549c80d176SSepherosa Ziehau 
559c80d176SSepherosa Ziehau #define IGP01E1000_PHY_DSP_RESET		0x1F33
569c80d176SSepherosa Ziehau 
579c80d176SSepherosa Ziehau #define IGP01E1000_PHY_DSP_FFE			0x1F35
589c80d176SSepherosa Ziehau #define IGP01E1000_PHY_DSP_FFE_CM_CP		0x0069
599c80d176SSepherosa Ziehau #define IGP01E1000_PHY_DSP_FFE_DEFAULT		0x002A
609c80d176SSepherosa Ziehau 
619c80d176SSepherosa Ziehau #define IGP01E1000_IEEE_FORCE_GIG		0x0140
629c80d176SSepherosa Ziehau #define IGP01E1000_IEEE_RESTART_AUTONEG		0x3300
639c80d176SSepherosa Ziehau 
649c80d176SSepherosa Ziehau #define IGP01E1000_AGC_LENGTH_SHIFT		7
659c80d176SSepherosa Ziehau #define IGP01E1000_AGC_RANGE			10
669c80d176SSepherosa Ziehau 
679c80d176SSepherosa Ziehau #define FFE_IDLE_ERR_COUNT_TIMEOUT_20		20
689c80d176SSepherosa Ziehau #define FFE_IDLE_ERR_COUNT_TIMEOUT_100		100
699c80d176SSepherosa Ziehau 
709c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_STATUS		0x20D0
719c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_SPARE_FUSE_STATUS	0x20D1
729c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_CONTROL		0x20DC
739c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_BYPASS		0x20DE
749c80d176SSepherosa Ziehau 
759c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_SPARE_FUSE_ENABLED	0x0100
769c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_FINE_MASK	0x0F80
779c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_COARSE_MASK	0x0070
789c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_COARSE_THRESH	0x0040
799c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_COARSE_10	0x0010
809c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_FINE_1		0x0080
819c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_FINE_10		0x0500
829c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_POLY_MASK	0xF000
839c80d176SSepherosa Ziehau #define IGP01E1000_ANALOG_FUSE_ENABLE_SW_CONTROL 0x0002
849c80d176SSepherosa Ziehau 
859c80d176SSepherosa Ziehau #define IGP01E1000_MSE_CHANNEL_D		0x000F
869c80d176SSepherosa Ziehau #define IGP01E1000_MSE_CHANNEL_C		0x00F0
879c80d176SSepherosa Ziehau #define IGP01E1000_MSE_CHANNEL_B		0x0F00
889c80d176SSepherosa Ziehau #define IGP01E1000_MSE_CHANNEL_A		0xF000
899c80d176SSepherosa Ziehau 
909c80d176SSepherosa Ziehau 
919c80d176SSepherosa Ziehau void e1000_init_script_state_82541(struct e1000_hw *hw, bool state);
929c80d176SSepherosa Ziehau #endif
93