xref: /linux/drivers/net/wireless/mediatek/mt76/mt76x0/initvals_init.h (revision cbecf716ca618fd44feda6bd9a64a8179d031fc5)
1*328cecf3SLee Jones /* SPDX-License-Identifier: GPL-2.0-only */
2*328cecf3SLee Jones /*
3*328cecf3SLee Jones  * (c) Copyright 2002-2010, Ralink Technology, Inc.
4*328cecf3SLee Jones  * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
5*328cecf3SLee Jones  * Copyright (C) 2018 Stanislaw Gruszka <stf_xl@wp.pl>
6*328cecf3SLee Jones  * Copyright (C) 2018 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
7*328cecf3SLee Jones  */
8*328cecf3SLee Jones 
9*328cecf3SLee Jones #ifndef __MT76X0U_INITVALS_INIT_H
10*328cecf3SLee Jones #define __MT76X0U_INITVALS_INIT_H
11*328cecf3SLee Jones 
12*328cecf3SLee Jones #include "phy.h"
13*328cecf3SLee Jones 
14*328cecf3SLee Jones static const struct mt76_reg_pair common_mac_reg_table[] = {
15*328cecf3SLee Jones 	{ MT_BCN_OFFSET(0),		0xf8f0e8e0 },
16*328cecf3SLee Jones 	{ MT_BCN_OFFSET(1),		0x6f77d0c8 },
17*328cecf3SLee Jones 	{ MT_LEGACY_BASIC_RATE,		0x0000013f },
18*328cecf3SLee Jones 	{ MT_HT_BASIC_RATE,		0x00008003 },
19*328cecf3SLee Jones 	{ MT_MAC_SYS_CTRL,		0x00000000 },
20*328cecf3SLee Jones 	{ MT_RX_FILTR_CFG,		0x00017f97 },
21*328cecf3SLee Jones 	{ MT_BKOFF_SLOT_CFG,		0x00000209 },
22*328cecf3SLee Jones 	{ MT_TX_SW_CFG0,		0x00000000 },
23*328cecf3SLee Jones 	{ MT_TX_SW_CFG1,		0x00080606 },
24*328cecf3SLee Jones 	{ MT_TX_LINK_CFG,		0x00001020 },
25*328cecf3SLee Jones 	{ MT_TX_TIMEOUT_CFG,		0x000a2090 },
26*328cecf3SLee Jones 	{ MT_MAX_LEN_CFG,		0xa0fff | 0x00001000 },
27*328cecf3SLee Jones 	{ MT_LED_CFG,			0x7f031e46 },
28*328cecf3SLee Jones 	{ MT_PBF_TX_MAX_PCNT,		0x1fbf1f1f },
29*328cecf3SLee Jones 	{ MT_PBF_RX_MAX_PCNT,		0x0000fe9f },
30*328cecf3SLee Jones 	{ MT_TX_RETRY_CFG,		0x47d01f0f },
31*328cecf3SLee Jones 	{ MT_AUTO_RSP_CFG,		0x00000013 },
32*328cecf3SLee Jones 	{ MT_CCK_PROT_CFG,		0x07f40003 },
33*328cecf3SLee Jones 	{ MT_OFDM_PROT_CFG,		0x07f42004 },
34*328cecf3SLee Jones 	{ MT_PBF_CFG,			0x00f40006 },
35*328cecf3SLee Jones 	{ MT_WPDMA_GLO_CFG,		0x00000030 },
36*328cecf3SLee Jones 	{ MT_GF20_PROT_CFG,		0x01742004 },
37*328cecf3SLee Jones 	{ MT_GF40_PROT_CFG,		0x03f42084 },
38*328cecf3SLee Jones 	{ MT_MM20_PROT_CFG,		0x01742004 },
39*328cecf3SLee Jones 	{ MT_MM40_PROT_CFG,		0x03f42084 },
40*328cecf3SLee Jones 	{ MT_TXOP_CTRL_CFG,		0x0000583f },
41*328cecf3SLee Jones 	{ MT_TX_RTS_CFG,		0x00ffff20 },
42*328cecf3SLee Jones 	{ MT_EXP_ACK_TIME,		0x002400ca },
43*328cecf3SLee Jones 	{ MT_TXOP_HLDR_ET,		0x00000002 },
44*328cecf3SLee Jones 	{ MT_XIFS_TIME_CFG,		0x33a41010 },
45*328cecf3SLee Jones 	{ MT_PWR_PIN_CFG,		0x00000000 },
46*328cecf3SLee Jones };
47*328cecf3SLee Jones 
48*328cecf3SLee Jones static const struct mt76_reg_pair mt76x0_mac_reg_table[] = {
49*328cecf3SLee Jones 	{ MT_IOCFG_6,			0xa0040080 },
50*328cecf3SLee Jones 	{ MT_PBF_SYS_CTRL,		0x00080c00 },
51*328cecf3SLee Jones 	{ MT_PBF_CFG,			0x77723c1f },
52*328cecf3SLee Jones 	{ MT_FCE_PSE_CTRL,		0x00000001 },
53*328cecf3SLee Jones 	{ MT_AMPDU_MAX_LEN_20M1S,	0xAAA99887 },
54*328cecf3SLee Jones 	{ MT_TX_SW_CFG0,		0x00000601 },
55*328cecf3SLee Jones 	{ MT_TX_SW_CFG1,		0x00040000 },
56*328cecf3SLee Jones 	{ MT_TX_SW_CFG2,		0x00000000 },
57*328cecf3SLee Jones 	{ 0xa44,			0x00000000 },
58*328cecf3SLee Jones 	{ MT_HEADER_TRANS_CTRL_REG,	0x00000000 },
59*328cecf3SLee Jones 	{ MT_TSO_CTRL,			0x00000000 },
60*328cecf3SLee Jones 	{ MT_BB_PA_MODE_CFG1,		0x00500055 },
61*328cecf3SLee Jones 	{ MT_RF_PA_MODE_CFG1,		0x00500055 },
62*328cecf3SLee Jones 	{ MT_TX_ALC_CFG_0,		0x2F2F000C },
63*328cecf3SLee Jones 	{ MT_TX0_BB_GAIN_ATTEN,		0x00000000 },
64*328cecf3SLee Jones 	{ MT_TX_PWR_CFG_0,		0x3A3A3A3A },
65*328cecf3SLee Jones 	{ MT_TX_PWR_CFG_1,		0x3A3A3A3A },
66*328cecf3SLee Jones 	{ MT_TX_PWR_CFG_2,		0x3A3A3A3A },
67*328cecf3SLee Jones 	{ MT_TX_PWR_CFG_3,		0x3A3A3A3A },
68*328cecf3SLee Jones 	{ MT_TX_PWR_CFG_4,		0x3A3A3A3A },
69*328cecf3SLee Jones 	{ MT_TX_PWR_CFG_7,		0x3A3A3A3A },
70*328cecf3SLee Jones 	{ MT_TX_PWR_CFG_8,		0x0000003A },
71*328cecf3SLee Jones 	{ MT_TX_PWR_CFG_9,		0x0000003A },
72*328cecf3SLee Jones 	{ 0x150C,			0x00000002 },
73*328cecf3SLee Jones 	{ 0x1238,			0x001700C8 },
74*328cecf3SLee Jones 	{ MT_LDO_CTRL_0,		0x00A647B6 },
75*328cecf3SLee Jones 	{ MT_LDO_CTRL_1,		0x6B006464 },
76*328cecf3SLee Jones 	{ MT_HT_BASIC_RATE,		0x00004003 },
77*328cecf3SLee Jones 	{ MT_HT_CTRL_CFG,		0x000001FF },
78*328cecf3SLee Jones 	{ MT_TXOP_HLDR_ET,		0x00000000 },
79*328cecf3SLee Jones 	{ MT_PN_PAD_MODE,		0x00000003 },
80*328cecf3SLee Jones 	{ MT_TX_PROT_CFG6,		0xe3f42004 },
81*328cecf3SLee Jones 	{ MT_TX_PROT_CFG7,		0xe3f42084 },
82*328cecf3SLee Jones 	{ MT_TX_PROT_CFG8,		0xe3f42104 },
83*328cecf3SLee Jones 	{ MT_VHT_HT_FBK_CFG1,		0xedcba980 },
84*328cecf3SLee Jones };
85*328cecf3SLee Jones 
86*328cecf3SLee Jones static const struct mt76_reg_pair mt76x0_bbp_init_tab[] = {
87*328cecf3SLee Jones 	{ MT_BBP(CORE, 1),	0x00000002 },
88*328cecf3SLee Jones 	{ MT_BBP(CORE, 4),	0x00000000 },
89*328cecf3SLee Jones 	{ MT_BBP(CORE, 24),	0x00000000 },
90*328cecf3SLee Jones 	{ MT_BBP(CORE, 32),	0x4003000a },
91*328cecf3SLee Jones 	{ MT_BBP(CORE, 42),	0x00000000 },
92*328cecf3SLee Jones 	{ MT_BBP(CORE, 44),	0x00000000 },
93*328cecf3SLee Jones 	{ MT_BBP(IBI, 11),	0x0FDE8081 },
94*328cecf3SLee Jones 	{ MT_BBP(AGC, 0),	0x00021400 },
95*328cecf3SLee Jones 	{ MT_BBP(AGC, 1),	0x00000003 },
96*328cecf3SLee Jones 	{ MT_BBP(AGC, 2),	0x003A6464 },
97*328cecf3SLee Jones 	{ MT_BBP(AGC, 15),	0x88A28CB8 },
98*328cecf3SLee Jones 	{ MT_BBP(AGC, 22),	0x00001E21 },
99*328cecf3SLee Jones 	{ MT_BBP(AGC, 23),	0x0000272C },
100*328cecf3SLee Jones 	{ MT_BBP(AGC, 24),	0x00002F3A },
101*328cecf3SLee Jones 	{ MT_BBP(AGC, 25),	0x8000005A },
102*328cecf3SLee Jones 	{ MT_BBP(AGC, 26),	0x007C2005 },
103*328cecf3SLee Jones 	{ MT_BBP(AGC, 33),	0x00003238 },
104*328cecf3SLee Jones 	{ MT_BBP(AGC, 34),	0x000A0C0C },
105*328cecf3SLee Jones 	{ MT_BBP(AGC, 37),	0x2121262C },
106*328cecf3SLee Jones 	{ MT_BBP(AGC, 41),	0x38383E45 },
107*328cecf3SLee Jones 	{ MT_BBP(AGC, 57),	0x00001010 },
108*328cecf3SLee Jones 	{ MT_BBP(AGC, 59),	0xBAA20E96 },
109*328cecf3SLee Jones 	{ MT_BBP(AGC, 63),	0x00000001 },
110*328cecf3SLee Jones 	{ MT_BBP(TXC, 0),	0x00280403 },
111*328cecf3SLee Jones 	{ MT_BBP(TXC, 1),	0x00000000 },
112*328cecf3SLee Jones 	{ MT_BBP(RXC, 1),	0x00000012 },
113*328cecf3SLee Jones 	{ MT_BBP(RXC, 2),	0x00000011 },
114*328cecf3SLee Jones 	{ MT_BBP(RXC, 3),	0x00000005 },
115*328cecf3SLee Jones 	{ MT_BBP(RXC, 4),	0x00000000 },
116*328cecf3SLee Jones 	{ MT_BBP(RXC, 5),	0xF977C4EC },
117*328cecf3SLee Jones 	{ MT_BBP(RXC, 7),	0x00000090 },
118*328cecf3SLee Jones 	{ MT_BBP(TXO, 8),	0x00000000 },
119*328cecf3SLee Jones 	{ MT_BBP(TXBE, 0),	0x00000000 },
120*328cecf3SLee Jones 	{ MT_BBP(TXBE, 4),	0x00000004 },
121*328cecf3SLee Jones 	{ MT_BBP(TXBE, 6),	0x00000000 },
122*328cecf3SLee Jones 	{ MT_BBP(TXBE, 8),	0x00000014 },
123*328cecf3SLee Jones 	{ MT_BBP(TXBE, 9),	0x20000000 },
124*328cecf3SLee Jones 	{ MT_BBP(TXBE, 10),	0x00000000 },
125*328cecf3SLee Jones 	{ MT_BBP(TXBE, 12),	0x00000000 },
126*328cecf3SLee Jones 	{ MT_BBP(TXBE, 13),	0x00000000 },
127*328cecf3SLee Jones 	{ MT_BBP(TXBE, 14),	0x00000000 },
128*328cecf3SLee Jones 	{ MT_BBP(TXBE, 15),	0x00000000 },
129*328cecf3SLee Jones 	{ MT_BBP(TXBE, 16),	0x00000000 },
130*328cecf3SLee Jones 	{ MT_BBP(TXBE, 17),	0x00000000 },
131*328cecf3SLee Jones 	{ MT_BBP(RXFE, 1),	0x00008800 },
132*328cecf3SLee Jones 	{ MT_BBP(RXFE, 3),	0x00000000 },
133*328cecf3SLee Jones 	{ MT_BBP(RXFE, 4),	0x00000000 },
134*328cecf3SLee Jones 	{ MT_BBP(RXO, 13),	0x00000192 },
135*328cecf3SLee Jones 	{ MT_BBP(RXO, 14),	0x00060612 },
136*328cecf3SLee Jones 	{ MT_BBP(RXO, 15),	0xC8321B18 },
137*328cecf3SLee Jones 	{ MT_BBP(RXO, 16),	0x0000001E },
138*328cecf3SLee Jones 	{ MT_BBP(RXO, 17),	0x00000000 },
139*328cecf3SLee Jones 	{ MT_BBP(RXO, 18),	0xCC00A993 },
140*328cecf3SLee Jones 	{ MT_BBP(RXO, 19),	0xB9CB9CB9 },
141*328cecf3SLee Jones 	{ MT_BBP(RXO, 20),	0x26c00057 },
142*328cecf3SLee Jones 	{ MT_BBP(RXO, 21),	0x00000001 },
143*328cecf3SLee Jones 	{ MT_BBP(RXO, 24),	0x00000006 },
144*328cecf3SLee Jones 	{ MT_BBP(RXO, 28),	0x0000003F },
145*328cecf3SLee Jones };
146*328cecf3SLee Jones 
147*328cecf3SLee Jones static const struct mt76_reg_pair mt76x0_dcoc_tab[] = {
148*328cecf3SLee Jones 	{ MT_BBP(CAL, 47), 0x000010F0 },
149*328cecf3SLee Jones 	{ MT_BBP(CAL, 48), 0x00008080 },
150*328cecf3SLee Jones 	{ MT_BBP(CAL, 49), 0x00000F07 },
151*328cecf3SLee Jones 	{ MT_BBP(CAL, 50), 0x00000040 },
152*328cecf3SLee Jones 	{ MT_BBP(CAL, 51), 0x00000404 },
153*328cecf3SLee Jones 	{ MT_BBP(CAL, 52), 0x00080803 },
154*328cecf3SLee Jones 	{ MT_BBP(CAL, 53), 0x00000704 },
155*328cecf3SLee Jones 	{ MT_BBP(CAL, 54), 0x00002828 },
156*328cecf3SLee Jones 	{ MT_BBP(CAL, 55), 0x00005050 },
157*328cecf3SLee Jones };
158*328cecf3SLee Jones 
159*328cecf3SLee Jones #endif
160