Home | History | Annotate | Line # | Download | only in dist
      1  1.1  alc /*
      2  1.1  alc  * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
      3  1.1  alc  * Copyright (c) 2002-2008 Atheros Communications, Inc.
      4  1.1  alc  *
      5  1.1  alc  * Permission to use, copy, modify, and/or distribute this software for any
      6  1.1  alc  * purpose with or without fee is hereby granted, provided that the above
      7  1.1  alc  * copyright notice and this permission notice appear in all copies.
      8  1.1  alc  *
      9  1.1  alc  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     10  1.1  alc  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     11  1.1  alc  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     12  1.1  alc  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     13  1.1  alc  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     14  1.1  alc  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     15  1.1  alc  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     16  1.1  alc  *
     17  1.1  alc  * $Id: ah_eeprom_v1.h,v 1.1.1.1 2008/12/11 04:46:23 alc Exp $
     18  1.1  alc  */
     19  1.1  alc #ifndef _ATH_AH_EEPROM_V1_H_
     20  1.1  alc #define _ATH_AH_EEPROM_V1_H_
     21  1.1  alc 
     22  1.1  alc #include "ah_eeprom.h"
     23  1.1  alc 
     24  1.1  alc /*
     25  1.1  alc  * EEPROM defines for Version 1 Crete EEPROM.
     26  1.1  alc  *
     27  1.1  alc  * The EEPROM is segmented into three sections:
     28  1.1  alc  *
     29  1.1  alc  *    PCI/Cardbus default configuration settings
     30  1.1  alc  *    Cardbus CIS tuples and vendor-specific data
     31  1.1  alc  *    Atheros-specific data
     32  1.1  alc  *
     33  1.1  alc  * EEPROM entries are read 32-bits at a time through the PCI bus
     34  1.1  alc  * interface but are all 16-bit values.
     35  1.1  alc  *
     36  1.1  alc  * Access to the Atheros-specific data is controlled by protection
     37  1.1  alc  * bits and the data is checksum'd.  The driver reads the Atheros
     38  1.1  alc  * data from the EEPROM at attach and caches it in its private state.
     39  1.1  alc  * This data includes the local regulatory domain, channel calibration
     40  1.1  alc  * settings, and phy-related configuration settings.
     41  1.1  alc  */
     42  1.1  alc #define	AR_EEPROM_MAC(i)	(0x1f-(i))/* MAC address word */
     43  1.1  alc #define	AR_EEPROM_MAGIC		0x3d	/* magic number */
     44  1.1  alc #define AR_EEPROM_PROTECT	0x3f	/* Atheros segment protect register */
     45  1.1  alc #define	AR_EEPROM_PROTOTECT_WP_128_191	0x80
     46  1.1  alc #define AR_EEPROM_REG_DOMAIN	0xbf	/* Current regulatory domain register */
     47  1.1  alc #define AR_EEPROM_ATHEROS_BASE	0xc0	/* Base of Atheros-specific data */
     48  1.1  alc #define AR_EEPROM_ATHEROS_MAX	64	/* 64x2=128 bytes of EEPROM settings */
     49  1.1  alc #define	AR_EEPROM_ATHEROS(n)	(AR_EEPROM_ATHEROS_BASE+(n))
     50  1.1  alc #define	AR_EEPROM_VERSION	AR_EEPROM_ATHEROS(1)
     51  1.1  alc #define AR_EEPROM_ATHEROS_TP_SETTINGS	0x09	/* Transmit power settings */
     52  1.1  alc #define AR_REG_DOMAINS_MAX	4	/* # of Regulatory Domains */
     53  1.1  alc #define AR_CHANNELS_MAX		5	/* # of Channel calibration groups */
     54  1.1  alc #define AR_TP_SETTINGS_SIZE	11	/* # locations/Channel group */
     55  1.1  alc #define AR_TP_SCALING_ENTRIES	11	/* # entries in transmit power dBm->pcdac */
     56  1.1  alc 
     57  1.1  alc /*
     58  1.1  alc  * NB: we store the rfsilent select+polarity data packed
     59  1.1  alc  *     with the encoding used in later parts so values
     60  1.1  alc  *     returned to applications are consistent.
     61  1.1  alc  */
     62  1.1  alc #define AR_EEPROM_RFSILENT_GPIO_SEL	0x001c
     63  1.1  alc #define AR_EEPROM_RFSILENT_GPIO_SEL_S	2
     64  1.1  alc #define AR_EEPROM_RFSILENT_POLARITY	0x0002
     65  1.1  alc #define AR_EEPROM_RFSILENT_POLARITY_S	1
     66  1.1  alc 
     67  1.1  alc #define AR_I2DBM(x)	((uint8_t)((x * 2) + 3))
     68  1.1  alc 
     69  1.1  alc /*
     70  1.1  alc  * Transmit power and channel calibration settings.
     71  1.1  alc  */
     72  1.1  alc struct tpcMap {
     73  1.1  alc 	uint8_t		pcdac[AR_TP_SCALING_ENTRIES];
     74  1.1  alc 	uint8_t		gainF[AR_TP_SCALING_ENTRIES];
     75  1.1  alc 	uint8_t		rate36;
     76  1.1  alc 	uint8_t		rate48;
     77  1.1  alc 	uint8_t		rate54;
     78  1.1  alc 	uint8_t		regdmn[AR_REG_DOMAINS_MAX];
     79  1.1  alc };
     80  1.1  alc 
     81  1.1  alc /*
     82  1.1  alc  * Information retrieved from EEPROM.
     83  1.1  alc  */
     84  1.1  alc typedef struct {
     85  1.1  alc 	uint16_t	ee_version;		/* Version field */
     86  1.1  alc 	uint16_t	ee_protect;		/* EEPROM protect field */
     87  1.1  alc 	uint16_t	ee_antenna;		/* Antenna Settings */
     88  1.1  alc 	uint16_t	ee_biasCurrents;	/* OB, DB */
     89  1.1  alc 	uint8_t		ee_thresh62;		/* thresh62 */
     90  1.1  alc 	uint8_t		ee_xlnaOn;		/* External LNA timing */
     91  1.1  alc 	uint8_t		ee_xpaOff;		/* Extern output stage timing */
     92  1.1  alc 	uint8_t		ee_xpaOn;		/* Extern output stage timing */
     93  1.1  alc 	uint8_t		ee_rfKill;		/* Single low bit signalling if RF Kill is implemented */
     94  1.1  alc 	uint8_t		ee_devType;		/* Type: PCI, miniPCI, CB */
     95  1.1  alc 	uint8_t		ee_regDomain[AR_REG_DOMAINS_MAX];
     96  1.1  alc 						/* calibrated reg domains */
     97  1.1  alc 	struct tpcMap	ee_tpc[AR_CHANNELS_MAX];
     98  1.1  alc } HAL_EEPROM_v1;
     99  1.1  alc #endif /* _ATH_AH_EEPROM_V1_H_ */
    100