summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/realtek/rtlwifi/rtl8192se/reg.h
blob: 45f968e0e57ca6cf1201e468e6194d227c09b040 (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
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright(c) 2009-2012  Realtek Corporation.*/

#ifndef __REALTEK_92S_REG_H__
#define __REALTEK_92S_REG_H__

/* 1. System Configuration Registers  */
#define	REG_SYS_ISO_CTRL			0x0000
#define	REG_SYS_FUNC_EN				0x0002
#define	PMC_FSM					0x0004
#define	SYS_CLKR				0x0008
#define	EPROM_CMD				0x000A
#define	EE_VPD					0x000C
#define	AFE_MISC				0x0010
#define	SPS0_CTRL				0x0011
#define	SPS1_CTRL				0x0018
#define	RF_CTRL					0x001F
#define	LDOA15_CTRL				0x0020
#define	LDOV12D_CTRL				0x0021
#define	LDOHCI12_CTRL				0x0022
#define	LDO_USB_SDIO				0x0023
#define	LPLDO_CTRL				0x0024
#define	AFE_XTAL_CTRL				0x0026
#define	AFE_PLL_CTRL				0x0028
#define	REG_EFUSE_CTRL				0x0030
#define	REG_EFUSE_TEST				0x0034
#define	PWR_DATA				0x0038
#define	DBG_PORT				0x003A
#define	DPS_TIMER				0x003C
#define	RCLK_MON				0x003E

/* 2. Command Control Registers	  */
#define	CMDR					0x0040
#define	TXPAUSE					0x0042
#define	LBKMD_SEL				0x0043
#define	TCR					0x0044
#define	RCR					0x0048
#define	MSR					0x004C
#define	SYSF_CFG				0x004D
#define	RX_PKY_LIMIT				0x004E
#define	MBIDCTRL				0x004F

/* 3. MACID Setting Registers	 */
#define	MACIDR					0x0050
#define	MACIDR0					0x0050
#define	MACIDR4					0x0054
#define	BSSIDR					0x0058
#define	HWVID					0x005E
#define	MAR					0x0060
#define	MBIDCAMCONTENT				0x0068
#define	MBIDCAMCFG				0x0070
#define	BUILDTIME				0x0074
#define	BUILDUSER				0x0078

#define	IDR0					MACIDR0
#define	IDR4					MACIDR4

/* 4. Timing Control Registers	 */
#define	TSFR					0x0080
#define	SLOT_TIME				0x0089
#define	USTIME					0x008A
#define	SIFS_CCK				0x008C
#define	SIFS_OFDM				0x008E
#define	PIFS_TIME				0x0090
#define	ACK_TIMEOUT				0x0091
#define	EIFSTR					0x0092
#define	BCN_INTERVAL				0x0094
#define	ATIMWND					0x0096
#define	BCN_DRV_EARLY_INT			0x0098
#define	BCN_DMATIME				0x009A
#define	BCN_ERR_THRESH				0x009C
#define	MLT					0x009D
#define	RSVD_MAC_TUNE_US			0x009E

/* 5. FIFO Control Registers	  */
#define RQPN					0x00A0
#define	RQPN1					0x00A0
#define	RQPN2					0x00A1
#define	RQPN3					0x00A2
#define	RQPN4					0x00A3
#define	RQPN5					0x00A4
#define	RQPN6					0x00A5
#define	RQPN7					0x00A6
#define	RQPN8					0x00A7
#define	RQPN9					0x00A8
#define	RQPN10					0x00A9
#define	LD_RQPN					0x00AB
#define	RXFF_BNDY				0x00AC
#define	RXRPT_BNDY				0x00B0
#define	TXPKTBUF_PGBNDY				0x00B4
#define	PBP					0x00B5
#define	RXDRVINFO_SZ				0x00B6
#define	TXFF_STATUS				0x00B7
#define	RXFF_STATUS				0x00B8
#define	TXFF_EMPTY_TH				0x00B9
#define	SDIO_RX_BLKSZ				0x00BC
#define	RXDMA					0x00BD
#define	RXPKT_NUM				0x00BE
#define	C2HCMD_UDT_SIZE				0x00C0
#define	C2HCMD_UDT_ADDR				0x00C2
#define	FIFOPAGE1				0x00C4
#define	FIFOPAGE2				0x00C8
#define	FIFOPAGE3				0x00CC
#define	FIFOPAGE4				0x00D0
#define	FIFOPAGE5				0x00D4
#define	FW_RSVD_PG_CRTL				0x00D8
#define	RXDMA_AGG_PG_TH				0x00D9
#define	TXDESC_MSK				0x00DC
#define	TXRPTFF_RDPTR				0x00E0
#define	TXRPTFF_WTPTR				0x00E4
#define	C2HFF_RDPTR				0x00E8
#define	C2HFF_WTPTR				0x00EC
#define	RXFF0_RDPTR				0x00F0
#define	RXFF0_WTPTR				0x00F4
#define	RXFF1_RDPTR				0x00F8
#define	RXFF1_WTPTR				0x00FC
#define	RXRPT0_RDPTR				0x0100
#define	RXRPT0_WTPTR				0x0104
#define	RXRPT1_RDPTR				0x0108
#define	RXRPT1_WTPTR				0x010C
#define	RX0_UDT_SIZE				0x0110
#define	RX1PKTNUM				0x0114
#define	RXFILTERMAP				0x0116
#define	RXFILTERMAP_GP1				0x0118
#define	RXFILTERMAP_GP2				0x011A
#define	RXFILTERMAP_GP3				0x011C
#define	BCNQ_CTRL				0x0120
#define	MGTQ_CTRL				0x0124
#define	HIQ_CTRL				0x0128
#define	VOTID7_CTRL				0x012c
#define	VOTID6_CTRL				0x0130
#define	VITID5_CTRL				0x0134
#define	VITID4_CTRL				0x0138
#define	BETID3_CTRL				0x013c
#define	BETID0_CTRL				0x0140
#define	BKTID2_CTRL				0x0144
#define	BKTID1_CTRL				0x0148
#define	CMDQ_CTRL				0x014c
#define	TXPKT_NUM_CTRL				0x0150
#define	TXQ_PGADD				0x0152
#define	TXFF_PG_NUM				0x0154
#define	TRXDMA_STATUS				0x0156

/* 6. Adaptive Control Registers   */
#define	INIMCS_SEL				0x0160
#define	TX_RATE_REG				INIMCS_SEL
#define	INIRTSMCS_SEL				0x0180
#define	RRSR					0x0181
#define	ARFR0					0x0184
#define	ARFR1					0x0188
#define	ARFR2					0x018C
#define	ARFR3					0x0190
#define	ARFR4					0x0194
#define	ARFR5					0x0198
#define	ARFR6					0x019C
#define	ARFR7					0x01A0
#define	AGGLEN_LMT_H				0x01A7
#define	AGGLEN_LMT_L				0x01A8
#define	DARFRC					0x01B0
#define	RARFRC					0x01B8
#define	MCS_TXAGC				0x01C0
#define	CCK_TXAGC				0x01C8

/* 7. EDCA Setting Registers */
#define	EDCAPARA_VO				0x01D0
#define	EDCAPARA_VI				0x01D4
#define	EDCAPARA_BE				0x01D8
#define	EDCAPARA_BK				0x01DC
#define	BCNTCFG					0x01E0
#define	CWRR					0x01E2
#define	ACMAVG					0x01E4
#define	ACMHWCTRL				0x01E7
#define	VO_ADMTM				0x01E8
#define	VI_ADMTM				0x01EC
#define	BE_ADMTM				0x01F0
#define	RETRY_LIMIT				0x01F4
#define	SG_RATE					0x01F6

/* 8. WMAC, BA and CCX related Register. */
#define	NAV_CTRL				0x0200
#define	BW_OPMODE				0x0203
#define	BACAMCMD				0x0204
#define	BACAMCONTENT				0x0208

/* the 0x2xx register WMAC definition */
#define	LBDLY					0x0210
#define	FWDLY					0x0211
#define	HWPC_RX_CTRL				0x0218
#define	MQIR					0x0220
#define	MAIR					0x0222
#define	MSIR					0x0224
#define	CLM_RESULT				0x0227
#define	NHM_RPI_CNT				0x0228
#define	RXERR_RPT				0x0230
#define	NAV_PROT_LEN				0x0234
#define	CFEND_TH				0x0236
#define	AMPDU_MIN_SPACE				0x0237
#define	TXOP_STALL_CTRL				0x0238

/* 9. Security Control Registers */
#define	REG_RWCAM				0x0240
#define	REG_WCAMI				0x0244
#define	REG_RCAMO				0x0248
#define	REG_CAMDBG				0x024C
#define	REG_SECR				0x0250

/* 10. Power Save Control Registers */
#define	WOW_CTRL				0x0260
#define	PSSTATUS				0x0261
#define	PSSWITCH				0x0262
#define	MIMOPS_WAIT_PERIOD			0x0263
#define	LPNAV_CTRL				0x0264
#define	WFM0					0x0270
#define	WFM1					0x0280
#define	WFM2					0x0290
#define	WFM3					0x02A0
#define	WFM4					0x02B0
#define	WFM5					0x02C0
#define	WFCRC					0x02D0
#define	FW_RPT_REG				0x02c4

/* 11. General Purpose Registers */
#define	PSTIME					0x02E0
#define	TIMER0					0x02E4
#define	TIMER1					0x02E8
#define	GPIO_IN_SE				0x02EC
#define	GPIO_IO_SEL				0x02EE
#define	MAC_PINMUX_CFG				0x02F1
#define	LEDCFG					0x02F2
#define	PHY_REG					0x02F3
#define	PHY_REG_DATA				0x02F4
#define	REG_EFUSE_CLK				0x02F8

/* 12. Host Interrupt Status Registers */
#define	INTA_MASK				0x0300
#define	ISR					0x0308

/* 13. Test mode and Debug Control Registers */
#define	DBG_PORT_SWITCH				0x003A
#define	BIST					0x0310
#define	DBS					0x0314
#define	CPUINST					0x0318
#define	CPUCAUSE				0x031C
#define	LBUS_ERR_ADDR				0x0320
#define	LBUS_ERR_CMD				0x0324
#define	LBUS_ERR_DATA_L				0x0328
#define	LBUS_ERR_DATA_H				0x032C
#define	LX_EXCEPTION_ADDR			0x0330
#define	WDG_CTRL				0x0334
#define	INTMTU					0x0338
#define	INTM					0x033A
#define	FDLOCKTURN0				0x033C
#define	FDLOCKTURN1				0x033D
#define	TRXPKTBUF_DBG_DATA			0x0340
#define	TRXPKTBUF_DBG_CTRL			0x0348
#define	DPLL					0x034A
#define	CBUS_ERR_ADDR				0x0350
#define	CBUS_ERR_CMD				0x0354
#define	CBUS_ERR_DATA_L				0x0358
#define	CBUS_ERR_DATA_H				0x035C
#define	USB_SIE_INTF_ADDR			0x0360
#define	USB_SIE_INTF_WD				0x0361
#define	USB_SIE_INTF_RD				0x0362
#define	USB_SIE_INTF_CTRL			0x0363
#define LBUS_MON_ADDR				0x0364
#define LBUS_ADDR_MASK				0x0368

/* Boundary is 0x37F */

/* 14. PCIE config register */
#define	TP_POLL					0x0500
#define	PM_CTRL					0x0502
#define	PCIF					0x0503

#define	THPDA					0x0514
#define	TMDA					0x0518
#define	TCDA					0x051C
#define	HDA					0x0520
#define	TVODA					0x0524
#define	TVIDA					0x0528
#define	TBEDA					0x052C
#define	TBKDA					0x0530
#define	TBDA					0x0534
#define	RCDA					0x0538
#define	RDQDA					0x053C
#define	DBI_WDATA				0x0540
#define	DBI_RDATA				0x0544
#define	DBI_CTRL				0x0548
#define	MDIO_DATA				0x0550
#define	MDIO_CTRL				0x0554
#define	PCI_RPWM				0x0561
#define	PCI_CPWM				0x0563

/* Config register	(Offset 0x800-) */
#define	PHY_CCA					0x803

/* Min Spacing related settings. */
#define	MAX_MSS_DENSITY_2T			0x13
#define	MAX_MSS_DENSITY_1T			0x0A

/* Rx DMA Control related settings */
#define	RXDMA_AGG_EN				BIT(7)

#define	RPWM					PCI_RPWM

/* Regsiter Bit and Content definition  */

#define	ISO_MD2PP				BIT(0)
#define	ISO_PA2PCIE				BIT(3)
#define	ISO_PLL2MD				BIT(4)
#define	ISO_PWC_DV2RP				BIT(11)
#define	ISO_PWC_RV2RP				BIT(12)


#define	FEN_MREGEN				BIT(15)
#define	FEN_DCORE				BIT(11)
#define	FEN_CPUEN				BIT(10)

#define	PAD_HWPD_IDN				BIT(22)

#define	SYS_CLKSEL_80M				BIT(0)
#define	SYS_PS_CLKSEL				BIT(1)
#define	SYS_CPU_CLKSEL				BIT(2)
#define	SYS_MAC_CLK_EN				BIT(11)
#define	SYS_SWHW_SEL				BIT(14)
#define	SYS_FWHW_SEL				BIT(15)

#define	CMDEEPROM_EN				BIT(5)
#define	CMDEERPOMSEL				BIT(4)
#define	CMD9346CR_9356SEL			BIT(4)

#define	AFE_MBEN				BIT(1)
#define	AFE_BGEN				BIT(0)

#define	SPS1_SWEN				BIT(1)
#define	SPS1_LDEN				BIT(0)

#define	RF_EN					BIT(0)
#define	RF_RSTB					BIT(1)
#define	RF_SDMRSTB				BIT(2)

#define	LDA15_EN				BIT(0)

#define	LDV12_EN				BIT(0)
#define	LDV12_SDBY				BIT(1)

#define	XTAL_GATE_AFE				BIT(10)

#define	APLL_EN					BIT(0)

#define	AFR_CARDBEN				BIT(0)
#define	AFR_CLKRUN_SEL				BIT(1)
#define	AFR_FUNCREGEN				BIT(2)

#define	APSDOFF_STATUS				BIT(15)
#define	APSDOFF					BIT(14)
#define	BBRSTN					BIT(13)
#de