iPXE
ar9003_eeprom.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2011 Atheros Communications Inc.
3  *
4  * Modified for iPXE by Scott K Logan <logans@cottsay.net> July 2011
5  * Original from Linux kernel 3.0.1
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef AR9003_EEPROM_H
21 #define AR9003_EEPROM_H
22 
23 FILE_LICENCE ( BSD2 );
24 FILE_SECBOOT ( FORBIDDEN );
25 
26 #define AR9300_EEP_VER 0xD000
27 #define AR9300_EEP_VER_MINOR_MASK 0xFFF
28 #define AR9300_EEP_MINOR_VER_1 0x1
29 #define AR9300_EEP_MINOR_VER AR9300_EEP_MINOR_VER_1
30 
31 /* 16-bit offset location start of calibration struct */
32 #define AR9300_EEP_START_LOC 256
33 #define AR9300_NUM_5G_CAL_PIERS 8
34 #define AR9300_NUM_2G_CAL_PIERS 3
35 #define AR9300_NUM_5G_20_TARGET_POWERS 8
36 #define AR9300_NUM_5G_40_TARGET_POWERS 8
37 #define AR9300_NUM_2G_CCK_TARGET_POWERS 2
38 #define AR9300_NUM_2G_20_TARGET_POWERS 3
39 #define AR9300_NUM_2G_40_TARGET_POWERS 3
40 /* #define AR9300_NUM_CTLS 21 */
41 #define AR9300_NUM_CTLS_5G 9
42 #define AR9300_NUM_CTLS_2G 12
43 #define AR9300_NUM_BAND_EDGES_5G 8
44 #define AR9300_NUM_BAND_EDGES_2G 4
45 #define AR9300_EEPMISC_BIG_ENDIAN 0x01
46 #define AR9300_EEPMISC_WOW 0x02
47 #define AR9300_CUSTOMER_DATA_SIZE 20
48 
49 #define FBIN2FREQ(x, y) ((y) ? (2300 + x) : (4800 + 5 * x))
50 #define AR9300_MAX_CHAINS 3
51 #define AR9300_ANT_16S 25
52 #define AR9300_FUTURE_MODAL_SZ 6
53 
54 #define AR9300_PAPRD_RATE_MASK 0x01ffffff
55 #define AR9300_PAPRD_SCALE_1 0x0e000000
56 #define AR9300_PAPRD_SCALE_1_S 25
57 #define AR9300_PAPRD_SCALE_2 0x70000000
58 #define AR9300_PAPRD_SCALE_2_S 28
59 
60 /* Delta from which to start power to pdadc table */
61 /* This offset is used in both open loop and closed loop power control
62  * schemes. In open loop power control, it is not really needed, but for
63  * the "sake of consistency" it was kept. For certain AP designs, this
64  * value is overwritten by the value in the flag "pwrTableOffset" just
65  * before writing the pdadc vs pwr into the chip registers.
66  */
67 #define AR9300_PWR_TABLE_OFFSET 0
68 
69 /* byte addressable */
70 #define AR9300_EEPROM_SIZE (16*1024)
71 
72 #define AR9300_BASE_ADDR_4K 0xfff
73 #define AR9300_BASE_ADDR 0x3ff
74 #define AR9300_BASE_ADDR_512 0x1ff
75 
76 #define AR9300_OTP_BASE 0x14000
77 #define AR9300_OTP_STATUS 0x15f18
78 #define AR9300_OTP_STATUS_TYPE 0x7
79 #define AR9300_OTP_STATUS_VALID 0x4
80 #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2
81 #define AR9300_OTP_STATUS_SM_BUSY 0x1
82 #define AR9300_OTP_READ_DATA 0x15f1c
83 
99 };
100 
106 };
107 
113 };
114 
153 };
154 
155 
156 struct eepFlags {
159 } __attribute__((packed));
160 
170 };
171 
174  /* 4 bits tx and 4 bits rx */
180  /* takes lower byte in eeprom location */
182  /* offset in dB to be added to beginning
183  * of pdadc table in calibration
184  */
187  /*
188  * bit0 - enable tx temp comp
189  * bit1 - enable tx volt comp
190  * bit2 - enable fastClock - default to 1
191  * bit3 - enable doubling - default to 1
192  * bit4 - enable internal regulator - default to 1
193  */
195  /* misc flags: bit0 - turn down drivestrength */
202  /* SW controlled internal regulator fields */
204 } __attribute__((packed));
205 
207  /* 4 idle, t1, t2, b (4 bits per setting) */
209  /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
211  /* 6 idle, t, r, rx1, rx12, b (2 bits each) */
213  /* 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
215  /* 3 xatten1_margin for merlin (0xa20c/b20c 16:12 */
219  /* spur channels in usual fbin coding format */
221  /* 3 Check if the register is per chain */
241 } __attribute__((packed));
242 
245  /* pdadc voltage at power measurement */
247  /* pcdac used for power measurement */
249  /* range is -60 to -127 create a mapping equation 1db resolution */
251  /*range is same as noisefloor */
253  /* temp measured when noisefloor cal was performed */
255 } __attribute__((packed));
256 
258  u8 tPow2x[4];
259 } __attribute__((packed));
260 
262  u8 tPow2x[14];
263 } __attribute__((packed));
264 
267 } __attribute__((packed));
268 
271 } __attribute__((packed));
272 
275  u8 future[13];
276 } __attribute__((packed));
277 
285 } __attribute__((packed));
286 
292 
294 
332 } __attribute__((packed));
333 
336 
337 u8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, int is_2ghz);
338 
339 unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah,
340  struct ath9k_channel *chan);
341 #endif
#define AR9300_MAX_CHAINS
Definition: ar9003_eeprom.h:50
#define AR9300_CUSTOMER_DATA_SIZE
Definition: ar9003_eeprom.h:47
u8 ctlIndex_2G[AR9300_NUM_CTLS_2G]
u8 spurChans[AR_EEPROM_MODAL_SPURS]
#define AR9300_NUM_5G_CAL_PIERS
Definition: ar9003_eeprom.h:33
u8 calTarget_freqbin_2GHT20[AR9300_NUM_2G_20_TARGET_POWERS]
unsigned short uint16_t
Definition: stdint.h:11
u8 calTarget_freqbin_2GHT40[AR9300_NUM_2G_40_TARGET_POWERS]
Definition: hw.h:657
u8 calFreqPier2G[AR9300_NUM_2G_CAL_PIERS]
u8 calTarget_freqbin_2G[AR9300_NUM_2G_20_TARGET_POWERS]
targetPowerHTRates
Definition: ar9003_eeprom.h:84
u8 ctlEdges[AR9300_NUM_BAND_EDGES_2G]
int32_t s32
Definition: stdint.h:23
#define AR9300_NUM_2G_CCK_TARGET_POWERS
Definition: ar9003_eeprom.h:37
#define AR_EEPROM_MODAL_SPURS
Definition: eeprom.h:26
u8 ctlEdges[AR9300_NUM_BAND_EDGES_5G]
CompressAlgorithm
s32 ar9003_hw_get_rx_gain_idx(struct ath_hw *ah)
targetPowerCckRates
u8 xatten1DBLow[AR9300_MAX_CHAINS]
#define AR9300_NUM_5G_20_TARGET_POWERS
Definition: ar9003_eeprom.h:35
targetPowerLegacyRates
u8 xatten1MarginLow[AR9300_MAX_CHAINS]
struct eepFlags opCapFlags
struct cal_tgt_pow_legacy calTargetPowerCck[AR9300_NUM_2G_CCK_TARGET_POWERS]
u8 ctlIndex_5G[AR9300_NUM_CTLS_5G]
#define AR9300_NUM_BAND_EDGES_5G
Definition: ar9003_eeprom.h:43
u8 ctl_freqbin_2G[AR9300_NUM_CTLS_2G][AR9300_NUM_BAND_EDGES_2G]
struct cal_tgt_pow_ht calTargetPower5GHT20[AR9300_NUM_5G_20_TARGET_POWERS]
unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, struct ath9k_channel *chan)
u8 xatten1MarginHigh[AR9300_MAX_CHAINS]
#define AR9300_NUM_CTLS_5G
Definition: ar9003_eeprom.h:41
FILE_LICENCE(BSD2)
u8 custData[AR9300_CUSTOMER_DATA_SIZE]
signed char int8_t
Definition: stdint.h:15
u8 calTarget_freqbin_5GHT20[AR9300_NUM_5G_20_TARGET_POWERS]
u8 * ar9003_get_spur_chan_ptr(struct ath_hw *ah, int is_2ghz)
struct cal_tgt_pow_ht calTargetPower2GHT20[AR9300_NUM_2G_20_TARGET_POWERS]
u8 db_stage3[AR9300_MAX_CHAINS]
u8 xatten1DBHigh[AR9300_MAX_CHAINS]
u8 calTarget_freqbin_5GHT40[AR9300_NUM_5G_40_TARGET_POWERS]
struct ar9300_modal_eep_header modalHeader2G
struct ar9300_BaseExtension_1 base_ext1
struct ar9300_modal_eep_header modalHeader5G
#define AR9300_NUM_2G_20_TARGET_POWERS
Definition: ar9003_eeprom.h:38
u8 calTarget_freqbin_Cck[AR9300_NUM_2G_CCK_TARGET_POWERS]
int8_t noiseFloorThreshCh[AR9300_MAX_CHAINS]
s32 ar9003_hw_get_tx_gain_idx(struct ath_hw *ah)
unsigned int uint32_t
Definition: stdint.h:12
struct ar9300_BaseExtension_2 base_ext2
u8 xatten1Margin[AR9300_MAX_CHAINS]
struct cal_tgt_pow_ht calTargetPower5GHT40[AR9300_NUM_5G_40_TARGET_POWERS]
#define AR9300_NUM_BAND_EDGES_2G
Definition: ar9003_eeprom.h:44
struct cal_ctl_data_2g ctlPowerData_2G[AR9300_NUM_CTLS_2G]
struct cal_tgt_pow_legacy calTargetPower2G[AR9300_NUM_2G_20_TARGET_POWERS]
u8 calTarget_freqbin_5G[AR9300_NUM_5G_20_TARGET_POWERS]
struct cal_tgt_pow_legacy calTargetPower5G[AR9300_NUM_5G_20_TARGET_POWERS]
enum CompressAlgorithm __attribute__
FILE_SECBOOT(FORBIDDEN)
#define AR9300_NUM_2G_CAL_PIERS
Definition: ar9003_eeprom.h:34
struct ar9300_cal_data_per_freq_op_loop calPierData2G[AR9300_MAX_CHAINS][AR9300_NUM_2G_CAL_PIERS]
struct cal_ctl_data_5g ctlPowerData_5G[AR9300_NUM_CTLS_5G]
u8 xatten1DB[AR9300_MAX_CHAINS]
ar9300_Rates
u8 calFreqPier5G[AR9300_NUM_5G_CAL_PIERS]
struct ar9300_base_eep_hdr baseEepHeader
#define AR9300_NUM_CTLS_2G
Definition: ar9003_eeprom.h:42
uint8_t ah
Definition: registers.h:85
u8 ob[AR9300_MAX_CHAINS]
#define AR9300_NUM_5G_40_TARGET_POWERS
Definition: ar9003_eeprom.h:36
struct ar9300_cal_data_per_freq_op_loop calPierData5G[AR9300_MAX_CHAINS][AR9300_NUM_5G_CAL_PIERS]
u8 db_stage4[AR9300_MAX_CHAINS]
#define AR9300_NUM_2G_40_TARGET_POWERS
Definition: ar9003_eeprom.h:39
u8 db_stage2[AR9300_MAX_CHAINS]
struct cal_tgt_pow_ht calTargetPower2GHT40[AR9300_NUM_2G_40_TARGET_POWERS]
uint8_t u8
Definition: stdint.h:20
uint16_t antCtrlChain[AR9300_MAX_CHAINS]
u8 ctl_freqbin_5G[AR9300_NUM_CTLS_5G][AR9300_NUM_BAND_EDGES_5G]