xref: /onnv-gate/usr/src/uts/common/io/rtw/max2820reg.h (revision 10448:fe6b44e693c2)
14689Sql147931 /*
2*10448SMikore.Li@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
34689Sql147931  * Use is subject to license terms.
44689Sql147931  */
54689Sql147931 
64689Sql147931 /*
74689Sql147931  * Copyright (c) 2004 David Young.  All rights reserved.
84689Sql147931  *
94689Sql147931  * This code was written by David Young.
104689Sql147931  *
114689Sql147931  * Redistribution and use in source and binary forms, with or without
124689Sql147931  * modification, are permitted provided that the following conditions
134689Sql147931  * are met:
144689Sql147931  * 1. Redistributions of source code must retain the above copyright
154689Sql147931  *    notice, this list of conditions and the following disclaimer.
164689Sql147931  * 2. Redistributions in binary form must reproduce the above copyright
174689Sql147931  *    notice, this list of conditions and the following disclaimer in the
184689Sql147931  *    documentation and/or other materials provided with the distribution.
194689Sql147931  * 3. Neither the name of the author nor the names of any co-contributors
204689Sql147931  *    may be used to endorse or promote products derived from this software
214689Sql147931  *    without specific prior written permission.
224689Sql147931  *
234689Sql147931  * THIS SOFTWARE IS PROVIDED BY David Young ``AS IS'' AND ANY
244689Sql147931  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
254689Sql147931  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
264689Sql147931  * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL David
274689Sql147931  * Young BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
284689Sql147931  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
294689Sql147931  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
304689Sql147931  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
314689Sql147931  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
324689Sql147931  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
334689Sql147931  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
344689Sql147931  * OF SUCH DAMAGE.
354689Sql147931  */
364689Sql147931 #ifndef _MAX2820REG_H_
374689Sql147931 #define	_MAX2820REG_H_
384689Sql147931 
39*10448SMikore.Li@Sun.COM #ifdef __cplusplus
40*10448SMikore.Li@Sun.COM extern "C" {
41*10448SMikore.Li@Sun.COM #endif
42*10448SMikore.Li@Sun.COM 
434689Sql147931 /*
444689Sql147931  * Serial bus format for Maxim MAX2820/MAX2820A/MAX2821/MAX2821A
454689Sql147931  * 2.4GHz 802.11b Zero-IF Transceivers
464689Sql147931  */
474689Sql147931 #define	MAX2820_TWI_ADDR_MASK	BITS(15, 12)
484689Sql147931 #define	MAX2820_TWI_DATA_MASK	BITS(11, 0)
494689Sql147931 
504689Sql147931 /*
514689Sql147931  * Registers for Maxim MAX2820/MAX2820A/MAX2821/MAX2821A 2.4GHz
524689Sql147931  * 802.11b Zero-IF Transceivers
534689Sql147931  */
544689Sql147931 #define	MAX2820_TEST		0		/* Test Register */
554689Sql147931 #define	MAX2820_TEST_DEFAULT	BITS(2, 0)	/* Always set to this value. */
564689Sql147931 
574689Sql147931 #define	MAX2820_ENABLE		1		/* Block-Enable Register */
584689Sql147931 #define	MAX2820_ENABLE_RSVD1	BIT(11)		/* reserved */
594689Sql147931 /*
604689Sql147931  * Transmit Baseband Filters Enable
614689Sql147931  * PAB_EN = SHDNB && (MAX2820_ENABLE_PAB || TX_ON)
624689Sql147931  */
634689Sql147931 #define	MAX2820_ENABLE_PAB	BIT(10)
644689Sql147931 /*
654689Sql147931  * Transmit Baseband Filters Enable
664689Sql147931  * TXFLT_EN = SHDNB && (MAX2820_ENABLE_TXFLT || TX_ON)
674689Sql147931  */
684689Sql147931 #define	MAX2820_ENABLE_TXFLT	BIT(9)
694689Sql147931 /*
704689Sql147931  * Tx Upconverter, VGA, and Driver Amp Enable
714689Sql147931  * TXUVD_EN = SHDNB && (MAX2820_ENABLE_TXUVD || TX_ON)
724689Sql147931  */
734689Sql147931 #define	MAX2820_ENABLE_TXUVD	BIT(8)
744689Sql147931 /*
754689Sql147931  * Receive Detector Enable
764689Sql147931  * DET_EN = SHDNB && (MAX2820_ENABLE_DET || RX_ON)
774689Sql147931  */
784689Sql147931 #define	MAX2820_ENABLE_DET	BIT(7)
794689Sql147931 /*
804689Sql147931  * Rx Downconverter, Filters, and AGC Amps Enable
814689Sql147931  * RXDFA_EN = SHDNB && (MAX2820_ENABLE_RXDFA || RX_ON)
824689Sql147931  */
834689Sql147931 #define	MAX2820_ENABLE_RXDFA	BIT(6)
844689Sql147931 /*
854689Sql147931  * Receive LNA Enable
864689Sql147931  * AT_EN = SHDNB && (MAX2820_ENABLE_RXLNA || RX_ON)
874689Sql147931  */
884689Sql147931 #define	MAX2820_ENABLE_RXLNA	BIT(5)
894689Sql147931 /*
904689Sql147931  * Auto-tuner Enable
914689Sql147931  * AT_EN = SHDNB && (MAX2820_ENABLE_AT || RX_ON || TX_ON)
924689Sql147931  */
934689Sql147931 #define	MAX2820_ENABLE_AT	BIT(4)
944689Sql147931 /*
954689Sql147931  * PLL Charge-Pump Enable
964689Sql147931  * CP_EN = SHDNB && MAX2820_ENABLE_CP
974689Sql147931  */
984689Sql147931 #define	MAX2820_ENABLE_CP	BIT(3)
994689Sql147931 /*
1004689Sql147931  * PLL Enable
1014689Sql147931  * PLL_EN = SHDNB && MAX2820_ENABLE_PLL
1024689Sql147931  */
1034689Sql147931 #define	MAX2820_ENABLE_PLL	BIT(2)
1044689Sql147931 /*
1054689Sql147931  * VCO Enable
1064689Sql147931  * VCO_EN = SHDNB && MAX2820_ENABLE_VCO
1074689Sql147931  */
1084689Sql147931 #define	MAX2820_ENABLE_VCO	BIT(1)
1094689Sql147931 #define	MAX2820_ENABLE_RSVD0	BIT(0)		/* reserved */
1104689Sql147931 #define	MAX2820_ENABLE_DEFAULT \
1114689Sql147931 	(MAX2820_ENABLE_AT|MAX2820_ENABLE_CP|\
1124689Sql147931 	MAX2820_ENABLE_PLL|MAX2820_ENABLE_VCO)
1134689Sql147931 
1144689Sql147931 #define	MAX2820_SYNTH		2	/* Synthesizer Register */
1154689Sql147931 #define	MAX2820_SYNTH_RSVD0	BITS(11, 7)	/* reserved */
1164689Sql147931 /*
1174689Sql147931  * Charge-Pump Current Select
1184689Sql147931  * 0 = +/-1mA
1194689Sql147931  * 1 = +/-2mA
1204689Sql147931  */
1214689Sql147931 #define	MAX2820_SYNTH_ICP	BIT(6)
1224689Sql147931 /*
1234689Sql147931  * Reference Frequency Divider
1244689Sql147931  * 0 = 22MHz
1254689Sql147931  * 1 = 44MHz
1264689Sql147931  */
1274689Sql147931 #define	MAX2820_SYNTH_R_MASK	BITS(5, 0)
1284689Sql147931 #define	MAX2820_SYNTH_R_22MHZ	LSHIFT(0, MAX2820_SYNTH_R_MASK)
1294689Sql147931 #define	MAX2820_SYNTH_R_44MHZ	LSHIFT(1, MAX2820_SYNTH_R_MASK)
1304689Sql147931 #define	MAX2820_SYNTH_ICP_DEFAULT	MAX2820_SYNTH_ICP
1314689Sql147931 #define	MAX2820_SYNTH_R_DEFAULT		LSHIFT(0, MAX2820_SYNTH_R_MASK)
1324689Sql147931 
1334689Sql147931 #define	MAX2820_CHANNEL		3	/* Channel Frequency Register */
1344689Sql147931 #define	MAX2820_CHANNEL_RSVD	BITS(11, 7)	/* reserved */
1354689Sql147931 /*
1364689Sql147931  * Channel Frequency Select
1374689Sql147931  * fLO = 2400MHz + CF * 1MHz
1384689Sql147931  */
1394689Sql147931 #define	MAX2820_CHANNEL_CF_MASK	BITS(6, 0)
1404689Sql147931 #define	MAX2820_CHANNEL_RSVD_DEFAULT	LSHIFT(0, MAX2820_CHANNEL_RSVD)
1414689Sql147931 #define	MAX2820_CHANNEL_CF_DEFAULT	LSHIFT(37, MAX2820_CHANNEL_CF_MASK)
1424689Sql147931 
1434689Sql147931 /*
1444689Sql147931  * Receiver Settings Register
1454689Sql147931  * MAX2820/MAX2821
1464689Sql147931  */
1474689Sql147931 #define	MAX2820_RECEIVE		4
1484689Sql147931 /*
1494689Sql147931  * VGA DC Offset Nulling Parameter 2
1504689Sql147931  */
1514689Sql147931 #define	MAX2820_RECEIVE_2C_MASK	BITS(11, 9)
1524689Sql147931 /*
1534689Sql147931  * VGA DC Offset Nulling Parameter 1
1544689Sql147931  */
1554689Sql147931 #define	MAX2820_RECEIVE_1C_MASK	BITS(8, 6)
1564689Sql147931 /*
1574689Sql147931  * Rx Level Detector Midpoint
1584689Sql147931  * Select
1594689Sql147931  * 11, 01 = 50.2mVp
1604689Sql147931  * 10     = 70.9mVp
1614689Sql147931  * 00     = 35.5mVp
1624689Sql147931  */
1634689Sql147931 #define	MAX2820_RECEIVE_DL_MASK	BITS(5, 4)
1644689Sql147931 /*
1654689Sql147931  * Special Function Select
1664689Sql147931  * 0 = OFF
1674689Sql147931  * 1 = ON
1684689Sql147931  */
1694689Sql147931 #define	MAX2820_RECEIVE_SF	BIT(3)
1704689Sql147931 /*
1714689Sql147931  * Receive Filter -3dB Frequency
1724689Sql147931  * Select (all frequencies are
1734689Sql147931  * approximate)
1744689Sql147931  */
1754689Sql147931 #define	MAX2820_RECEIVE_BW_MASK	BITS(2, 0)
1764689Sql147931 /* 8.5MHz */
1774689Sql147931 #define	MAX2820_RECEIVE_BW_8_5MHZ	LSHIFT(0, MAX2820_RECEIVE_BW_MASK)
1784689Sql147931 #define	MAX2820_RECEIVE_BW_8MHZ		LSHIFT(1, MAX2820_RECEIVE_BW_MASK)
1794689Sql147931 #define	MAX2820_RECEIVE_BW_7_5MHZ	LSHIFT(2, MAX2820_RECEIVE_BW_MASK)
1804689Sql147931 #define	MAX2820_RECEIVE_BW_7MHZ		LSHIFT(3, MAX2820_RECEIVE_BW_MASK)
1814689Sql147931 #define	MAX2820_RECEIVE_BW_6_5MHZ	LSHIFT(4, MAX2820_RECEIVE_BW_MASK)
1824689Sql147931 #define	MAX2820_RECEIVE_BW_6MHZ		LSHIFT(5, MAX2820_RECEIVE_BW_MASK)
1834689Sql147931 #define	MAX2820_RECEIVE_2C_DEFAULT	LSHIFT(7, MAX2820_RECEIVE_2C_MASK)
1844689Sql147931 #define	MAX2820_RECEIVE_1C_DEFAULT	LSHIFT(7, MAX2820_RECEIVE_1C_MASK)
1854689Sql147931 #define	MAX2820_RECEIVE_DL_DEFAULT	LSHIFT(1, MAX2820_RECEIVE_DL_MASK)
1864689Sql147931 #define	MAX2820_RECEIVE_SF_DEFAULT	LSHIFT(0, MAX2820_RECEIVE_SF)
1874689Sql147931 #define	MAX2820_RECEIVE_BW_DEFAULT	MAX2820_RECEIVE_BW_7_5MHZ
1884689Sql147931 
1894689Sql147931 /*
1904689Sql147931  * Receiver Settings Register,
1914689Sql147931  * MAX2820A/MAX2821A
1924689Sql147931  */
1934689Sql147931 #define	MAX2820A_RECEIVE	4
1944689Sql147931 /* VGA DC Offset Nulling Parameter 2 */
1954689Sql147931 #define	MAX2820A_RECEIVE_2C_MASK	BITS(11, 9)
1964689Sql147931 #define	MAX2820A_RECEIVE_2C_DEFAULT	LSHIFT(7, MAX2820A_RECEIVE_2C_MASK)
1974689Sql147931 /* VGA DC Offset Nulling Parameter 1 */
1984689Sql147931 #define	MAX2820A_RECEIVE_1C_MASK	BITS(8, 6)
1994689Sql147931 #define	MAX2820A_RECEIVE_1C_DEFAULT	LSHIFT(7, MAX2820A_RECEIVE_1C_MASK)
2004689Sql147931 #define	MAX2820A_RECEIVE_RSVD0_MASK	BITS(5, 3)
2014689Sql147931 #define	MAX2820A_RECEIVE_RSVD0_DEFAULT	LSHIFT(2, MAX2820A_RECEIVE_RSVD0_MASK)
2024689Sql147931 #define	MAX2820A_RECEIVE_RSVD1_MASK	BITS(2, 0)
2034689Sql147931 #define	MAX2820A_RECEIVE_RSVD1_DEFAULT	LSHIFT(2, MAX2820_RECEIVE_RSVD1_MASK)
2044689Sql147931 
2054689Sql147931 #define	MAX2820_TRANSMIT	5	/* Transmitter Settings Reg. */
2064689Sql147931 #define	MAX2820_TRANSMIT_RSVD_MASK	BITS(11, 4)	/* reserved */
2074689Sql147931 /*
2084689Sql147931  * PA Bias Select
2094689Sql147931  * 15 = Highest
2104689Sql147931  * 0 = Lowest
2114689Sql147931  */
2124689Sql147931 #define	MAX2820_TRANSMIT_PA_MASK	BITS(3, 0)
2134689Sql147931 #define	MAX2820_TRANSMIT_PA_DEFAULT	LSHIFT(0, MAX2820_TRANSMIT_PA_MASK)
2144689Sql147931 
215*10448SMikore.Li@Sun.COM #ifdef __cplusplus
216*10448SMikore.Li@Sun.COM }
217*10448SMikore.Li@Sun.COM #endif
218*10448SMikore.Li@Sun.COM 
2194689Sql147931 #endif /* _MAX2820REG_H_ */
220