summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/rtl871x_mp_phy_regdef.h
blob: 2e9120a21a0be890cc3ad07359d274618d801c72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
/*****************************************************************************
 *	Copyright(c) 2008,  RealTEK Technology Inc. All Right Reserved.
 *
 * Module:	__INC_HAL8192SPHYREG_H
 *
 *
 * Note:	1. Define PMAC/BB register map
 *			2. Define RF register map
 *			3. PMAC/BB register bit mask.
 *			4. RF reg bit mask.
 *			5. Other BB/RF relative definition.
 *
 *
 * Export:	Constants, macro, functions(API), global variables(None).
 *
 * Abbrev:
 *
 * History:
 *	Data			Who		Remark
 *	08/07/2007	MHC		1. Porting from 9x series PHYCFG.h.
 *						2. Reorganize code architecture.
 *	09/25/2008	MH		1. Add RL6052 register definition
 *
 *****************************************************************************/
#ifndef __RTL871X_MP_PHY_REGDEF_H
#define __RTL871X_MP_PHY_REGDEF_H


/*--------------------------Define Parameters-------------------------------*/

/*============================================================
 *       8192S Regsiter offset definition
 *============================================================
 *
 *
 * BB-PHY register PMAC 0x100 PHY 0x800 - 0xEFF
 * 1. PMAC duplicate register due to connection: RF_Mode, TRxRN, NumOf L-STF
 * 2. 0x800/0x900/0xA00/0xC00/0xD00/0xE00
 * 3. RF register 0x00-2E
 * 4. Bit Mask for BB/RF register
 * 5. Other definition for BB/RF R/W
 *
 * 1. PMAC duplicate register due to connection: RF_Mode, TRxRN, NumOf L-STF
 * 1. Page1(0x100)
 */
#define	rPMAC_Reset			0x100
#define	rPMAC_TxStart			0x104
#define	rPMAC_TxLegacySIG		0x108
#define	rPMAC_TxHTSIG1			0x10c
#define	rPMAC_TxHTSIG2			0x110
#define	rPMAC_PHYDebug			0x114
#define	rPMAC_TxPacketNum		0x118
#define	rPMAC_TxIdle			0x11c
#define	rPMAC_TxMACHeader0		0x120
#define	rPMAC_TxMACHeader1		0x124
#define	rPMAC_TxMACHeader2		0x128
#define	rPMAC_TxMACHeader3		0x12c
#define	rPMAC_TxMACHeader4		0x130
#define	rPMAC_TxMACHeader5		0x134
#define	rPMAC_TxDataType		0x138
#define	rPMAC_TxRandomSeed		0x13c
#define	rPMAC_CCKPLCPPreamble		0x140
#define	rPMAC_CCKPLCPHeader		0x144
#define	rPMAC_CCKCRC16			0x148
#define	rPMAC_OFDMRxCRC32OK		0x170
#define	rPMAC_OFDMRxCRC32Er		0x174
#define	rPMAC_OFDMRxParityEr		0x178
#define	rPMAC_OFDMRxCRC8Er		0x17c
#define	rPMAC_CCKCRxRC16Er		0x180
#define	rPMAC_CCKCRxRC32Er		0x184
#define	rPMAC_CCKCRxRC32OK		0x188
#define	rPMAC_TxStatus			0x18c

/*
 * 2. Page2(0x200)
 *
 * The following two definition are only used for USB interface.
 *#define RF_BB_CMD_ADDR	0x02c0	// RF/BB read/write command address.
 *#define RF_BB_CMD_DATA	0x02c4	// RF/BB read/write command data.
 *
 *
 * 3. Page8(0x800)
 */
#define	rFPGA0_RFMOD			0x800	/*RF mode & CCK TxSC RF
						 * BW Setting?? */
#define	rFPGA0_TxInfo			0x804	/* Status report?? */
#define	rFPGA0_PSDFunction		0x808
#define	rFPGA0_TxGainStage		0x80c	/* Set TX PWR init gain? */
#define	rFPGA0_RFTiming1		0x810	/* Useless now */
#define	rFPGA0_RFTiming2		0x814
#define	rFPGA0_XA_HSSIParameter1	0x820	/* RF 3 wire register */
#define	rFPGA0_XA_HSSIParameter2	0x824
#define	rFPGA0_XB_HSSIParameter1	0x828
#define	rFPGA0_XB_HSSIParameter2	0x82c
#define	rFPGA0_XC_HSSIParameter1	0x830
#define	rFPGA0_XC_HSSIParameter2	0x834
#define	rFPGA0_XD_HSSIParameter1	0x838
#define	rFPGA0_XD_HSSIParameter2	0x83c
#define	rFPGA0_XA_LSSIParameter		0x840
#define	rFPGA0_XB_LSSIParameter		0x844
#define	rFPGA0_XC_LSSIParameter		0x848
#define	rFPGA0_XD_LSSIParameter		0x84c

#define	rFPGA0_RFWakeUpParameter	0x850	/* Useless now */
#define	rFPGA0_RFSleepUpParameter	0x854

#define	rFPGA0_XAB_SwitchControl	0x858	/* RF Channel switch */
#define	rFPGA0_XCD_SwitchControl	0x85c

#define	rFPGA0_XA_RFInterfaceOE		0x860	/* RF Channel switch */
#define	rFPGA0_XB_RFInterfaceOE		0x864
#define	rFPGA0_XC_RFInterfaceOE		0x868
#define	rFPGA0_XD_RFInterfaceOE		0x86c
#define	rFPGA0_XAB_RFInterfaceSW	0x870	/* RF Interface Software Ctrl */
#define	rFPGA0_XCD_RFInterfaceSW	0x874

#define	rFPGA0_XAB_RFParameter		0x878	/* RF Parameter */
#define	rFPGA0_XCD_RFParameter		0x87c

#define	rFPGA0_AnalogParameter1		0x880	/* Crystal cap setting
						 * RF-R/W protection
						 * for parameter4?? */
#define	rFPGA0_AnalogParameter2		0x884
#define	rFPGA0_AnalogParameter3		0x888	/* Useless now */
#define	rFPGA0_AnalogParameter4		0x88c

#define	rFPGA0_XA_LSSIReadBack		0x8a0	/* Tranceiver LSSI Readback */
#define	rFPGA0_XB_LSSIReadBack		0x8a4
#define	rFPGA0_XC_LSSIReadBack		0x8a8
#define	rFPGA0_XD_LSSIReadBack		0x8ac

#define	rFPGA0_PSDReport		0x8b4	/* Useless now */
#define	rFPGA0_XAB_RFInterfaceRB	0x8e0	/* Useless now */
#define	rFPGA0_XCD_RFInterfaceRB	0x8e4	/* Useless now */

/*
 * 4. Page9(0x900)
 */
#define	rFPGA1_RFMOD			0x900	/* RF mode & OFDM TxSC */

#define	rFPGA1_TxBlock			0x904	/* Useless now */
#define	rFPGA1_DebugSelect		0x908	/* Useless now */
#define	rFPGA1_TxInfo			0x90c	/* Useless now */

/*
 * 5. PageA(0xA00)
 *
 * Set Control channel to upper or lower.
 * These settings are required only for 40MHz */
#define	rCCK0_System			0xa00

#define	rCCK0_AFESetting		0xa04	/* Disable init gain now */
#define	rCCK0_CCA			0xa08	/* Disable init gain now */

#define	rCCK0_RxAGC1			0xa0c
/* AGC default value, saturation level
 * Antenna Diversity, RX AGC, LNA Threshold, RX LNA Threshold useless now.
 * Not the same as 90 series */
#define	rCCK0_RxAGC2			0xa10	/* AGC & DAGC */

#define	rCCK0_RxHP			0xa14

#define	rCCK0_DSPParameter1		0xa18	/* Timing recovery & Channel
						 * estimation threshold */
#define	rCCK0_DSPParameter2		0xa1c	/* SQ threshold */

#define	rCCK0_TxFilter1			0xa20
#define	rCCK0_TxFilter2			0xa24
#define	rCCK0_DebugPort			0xa28	/* debug port and Tx filter3 */
#define	rCCK0_FalseAlarmReport		0xa2c	/* 0xa2d useless now 0xa30-a4f
						 * channel report */
#define	rCCK0_TRSSIReport		0xa50
#define	rCCK0_RxReport			0xa54   /* 0xa57 */
#define	rCCK0_FACounterLower		0xa5c   /* 0xa5b */
#define	rCCK0_FACounterUpper		0xa58   /* 0xa5c */

/*
 * 6. PageC(0xC00)
 */
#define	rOFDM0_LSTF			0xc00
#define	rOFDM0_TRxPathEnable		0xc04
#define	rOFDM0_TRMuxPar			0xc08
#define	rOFDM0_TRSWIsolation		0xc0c

/*RxIQ DC offset, Rx digital filter, DC notch filter */
#define	rOFDM0_XARxAFE			0xc10
#define	rOFDM0_XARxIQImbalance		0xc14  /* RxIQ imbalance matrix */
#define	rOFDM0_XBRxAFE			0xc18
#define	rOFDM0_XBRxIQImbalance		0xc1c
#define	rOFDM0_XCRxAFE			0xc20
#define	rOFDM0_XCRxIQImbalance		0xc24
#define	rOFDM0_XDRxAFE			0xc28
#define	rOFDM0_XDRxIQImbalance		0xc2c

#define	rOFDM0_RxDetector1		0xc30  /* PD,BW & SBD DM tune
						* init gain */
#define	rOFDM0_RxDetector2		0xc34  /* SBD & Fame Sync. */
#define	rOFDM0_RxDetector3		0xc38  /* Frame Sync. */
#define	rOFDM0_RxDetector4		0xc3c  /* PD, SBD, Frame Sync &
						* Short-GI */

#define	rOFDM0_RxDSP			0xc40  /* Rx Sync Path */
#define	rOFDM0_CFOandDAGC		0xc44  /* CFO & DAGC */
#define	rOFDM0_CCADropThreshold		0xc48 /* CCA Drop threshold */
#define	rOFDM0_ECCAThreshold		0xc4c /* energy CCA */

#define	rOFDM0_XAAGCCore1		0xc50	/* DIG */
#define	rOFDM0_XAAGCCore2		0xc54
#define	rOFDM0_XBAGCCore1		0xc58
#define	rOFDM0_XBAGCCore2		0xc5c
#define	rOFDM0_XCAGCCore1		0xc60
#define	rOFDM0_XCAGCCore2		0xc64
#define	rOFDM0_XDAGCCore1		0xc68
#define	rOFDM0_XDAGCCore2		0xc6c
#define	rOFDM0_AGCParameter1		0xc70
#define	rOFDM0_AGCParameter2		0xc74
#define	rOFDM0_AGCRSSITable		0xc78
#define	rOFDM0_HTSTFAGC			0xc7c

#define	rOFDM0_XATxIQImbalance		0xc80	/* TX PWR TRACK and DIG */
#define	rOFDM0_XATxAFE			0xc84
#define	rOFDM0_XBTxIQImbalance		0xc88
#define	rOFDM0_XBTxAFE			0xc8c
#define	rOFDM0_XCTxIQImbalance		0xc90
#define	rOFDM0_XCTxAFE			0xc94
#define	rOFDM0_XDTxIQImbalance		0xc98
#define	rOFDM0_XDTxAFE			0xc9c

#define	rOFDM0_RxHPParameter		0xce0
#define	rOFDM0_TxPseudoNoiseWgt		0xce4
#define	rOFDM0_FrameSync		0xcf0
#define	rOFDM0_DFSReport		0xcf4
#define	rOFDM0_TxCoeff1			0xca4
#define	rOFDM0_TxCoeff2			0xca8
#define	rOFDM0_TxCoeff3			0xcac
#define	rOFDM0_TxCoeff4			0xcb0
#define	rOFDM0_TxCoeff5			0xcb4
#define	rOFDM0_TxCoeff6			0xcb8

/*
 * 7. PageD(0xD00)
 */
#define	rOFDM1_LSTF			0xd00
#define	rOFDM1_TRxPathEnable		0xd04

#define	rOFDM1_CFO			0xd08	/* No setting now */
#define	rOFDM1_CSI1			0xd10
#define	rOFDM1_SBD			0xd14
#define	rOFDM1_CSI2			0xd18
#define	rOFDM1_CFOTracking		0xd2c
#define	rOFDM1_TRxMesaure1		0xd34
#define	rOFDM1_IntfDet			0xd3c
#define	rOFDM1_PseudoNoiseStateAB	0xd50
#define	rOFDM1_PseudoNoiseStateCD	0xd54
#define	rOFDM1_RxPseudoNoiseWgt		0xd58

#define	rOFDM_PHYCounter1		0xda0  /* cca, parity fail */
#define	rOFDM_PHYCounter2		0xda4  /* rate illegal, crc8 fail */
#define	rOFDM_PHYCounter3		0xda8  /* MCS not support */
#define	rOFDM_ShortCFOAB		0xdac  /* No setting now */
#define	rOFDM_ShortCFOCD		0xdb0
#define	rOFDM_LongCFOAB			0xdb4
#define	rOFDM_LongCFOCD			0xdb8
#define	rOFDM_TailCFOAB			0xdbc
#define	rOFDM_TailCFOCD			0xdc0
#define	rOFDM_PWMeasure1		0xdc4
#define	rOFDM_PWMeasure2		0xdc8
#define	rOFDM_BWReport			0xdcc
#define	rOFDM_AGCReport			0xdd0
#define	rOFDM_RxSNR			0xdd4
#define	rOFDM_RxEVMCSI			0xdd8
#define	rOFDM_SIGReport			0xddc

/*
 * 8. PageE(0xE00)
 */
#define	rTxAGC_Rate18_06		0xe00
#define	rTxAGC_Rate54_24		0xe04
#define	rTxAGC_CCK_Mcs32		0xe08
#define	rTxAGC_Mcs03_Mcs00		0xe10
#define	rTxAGC_Mcs07_Mcs04		0xe14
#define	rTxAGC_Mcs11_Mcs08		0xe18
#define	rTxAGC_Mcs15_Mcs12		0xe1c

/* Analog- control in RX_WAIT_CCA : REG: EE0
 * [Analog- Power & Control Register] */
#define		rRx_Wait_CCCA		0xe70
#define	rAnapar_Ctrl_BB			0xee0

/*
 * 7. RF Register 0x00-0x2E (RF 8256)
 *    RF-0222D 0x00-3F
 *
 * Zebra1
 */
#define	rZebra1_HSSIEnable		0x0	/* Useless now */
#define	rZebra1_TRxEnable1		0x1
#define	rZebra1_TRxEnable2		0x2
#define	rZebra1_AGC			0x4
#define	rZebra1_ChargePump		0x5
#define	rZebra1_Channel			0x7	/* RF channel switch */
#define	rZebra1_TxGain			0x8	/* Useless now */
#define	rZebra1_TxLPF			0x9
#define	rZebra1_RxLPF			0xb
#define	rZebra1_RxHPFCorner		0xc

/* Zebra4 */
#define	rGlobalCtrl			0	/* Useless now */
#define	rRTL8256_TxLPF			19
#define	rRTL8256_RxLPF			11

/* RTL8258 */
#define	rRTL8258_TxLPF			0x11	/* Useless now */
#define	rRTL8258_RxLPF			0x13
#define	rRTL8258_RSSILPF		0xa

/* RL6052 Register definition */
#define	RF_AC				0x00
#define	RF_IQADJ_G1			0x01
#define	RF_IQADJ_G2			0x02
#define	RF_POW_TRSW			0x05

#define	RF_GAIN_RX			0x06
#define	RF_GAIN_TX			0x07

#define	RF_TXM_IDAC			0x08
#define	RF_BS_IQGEN			0x0F

#define	RF_MODE1			0x10
#define	RF_MODE2			0x11

#define	RF_RX_AGC_HP			0x12
#define	RF_TX_AGC			0x13
#define	RF_BIAS				0x14
#define	RF_IPA				0x15
#define	RF_POW_ABILITY			0x17
#define	RF_MODE_AG			0x18
#define	rRfChannel			0x18	/* RF channel and BW switch */
#define	RF_CHNLBW			0x18	/* RF channel and BW switch */
#define	RF_TOP				0x19
#define	RF_RX_G1			0x1A
#define	RF_RX_G2			0x1B
#define	RF_RX_BB2			0x1C
#define	RF_RX_BB1			0x1D

#define	RF_RCK1				0x1E
#define	RF_RCK2				0x1F

#define	RF_TX_G1			0x20
#define	RF_TX_G2			0x21
#define	RF_TX_G3			0x22

#define	RF_TX_BB1			0x23
#define	RF_T_METER			0x24

#define	RF_SYN_G1			0x25	/* RF TX Power control */
#define	RF_SYN_G2			0x26	/* RF TX Power control */
#define	RF_SYN_G3			0x27	/* RF TX Power control */
#define	RF_SYN_G4			0x28	/* RF TX Power control */
#define	RF_SYN_G5			0x29	/* RF TX Power control */
#define	RF_SYN_G6			0x2A	/* RF TX Power control */
#define	RF_SYN_G7			0x2B	/* RF TX Power control */
#define	RF_SYN_G8			0x2C	/* RF TX Power control */

#define	RF_RCK_OS			0x30	/* RF TX PA control */

#define	RF_TXPA_G1			0x31	/* RF TX PA control */
#define	RF_TXPA_G2			0x32	/* RF TX PA control */
#define	RF_TXPA_G3			0x33	/* RF TX PA control */

/*
 * Bit Mask
 *
 * 1. Page1(0x100) */
#define	bBBResetB			0x100	/* Useless now? */
#define	bGlobalResetB			0x200
#define	bOFDMTxStart			0x4
#define	bCCKTxStart			0x8
#define	bCRC32Debug			0x100
#define	bPMACLoopback			0x10
#define	bTxLSIG				0xffffff
#define	bOFDMTxRate			0xf
#define	bOFDMTxReserved			0x10
#define	bOFDMTxLength			0x1ffe0
#define	bOFDMTxParity			0x20000
#define	bTxHTSIG1			0xffffff
#define	bTxHTMCSRate			0x7f