xref: /openbmc/linux/drivers/net/wireless/mediatek/mt7601u/initvals.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*1802d0beSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2c869f77dSJakub Kicinski /*
3c869f77dSJakub Kicinski  * (c) Copyright 2002-2010, Ralink Technology, Inc.
4c869f77dSJakub Kicinski  * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
5c869f77dSJakub Kicinski  */
6c869f77dSJakub Kicinski 
7c869f77dSJakub Kicinski #ifndef __MT7601U_INITVALS_H
8c869f77dSJakub Kicinski #define __MT7601U_INITVALS_H
9c869f77dSJakub Kicinski 
10c869f77dSJakub Kicinski static const struct mt76_reg_pair bbp_common_vals[] = {
11c869f77dSJakub Kicinski 	{  65,	0x2c },
12c869f77dSJakub Kicinski 	{  66,	0x38 },
13c869f77dSJakub Kicinski 	{  68,	0x0b },
14c869f77dSJakub Kicinski 	{  69,	0x12 },
15c869f77dSJakub Kicinski 	{  70,	0x0a },
16c869f77dSJakub Kicinski 	{  73,	0x10 },
17c869f77dSJakub Kicinski 	{  81,	0x37 },
18c869f77dSJakub Kicinski 	{  82,	0x62 },
19c869f77dSJakub Kicinski 	{  83,	0x6a },
20c869f77dSJakub Kicinski 	{  84,	0x99 },
21c869f77dSJakub Kicinski 	{  86,	0x00 },
22c869f77dSJakub Kicinski 	{  91,	0x04 },
23c869f77dSJakub Kicinski 	{  92,	0x00 },
24c869f77dSJakub Kicinski 	{ 103,	0x00 },
25c869f77dSJakub Kicinski 	{ 105,	0x05 },
26c869f77dSJakub Kicinski 	{ 106,	0x35 },
27c869f77dSJakub Kicinski };
28c869f77dSJakub Kicinski 
29c869f77dSJakub Kicinski static const struct mt76_reg_pair bbp_chip_vals[] = {
30c869f77dSJakub Kicinski 	{   1, 0x04 },	{   4, 0x40 },	{  20, 0x06 },	{  31, 0x08 },
31c869f77dSJakub Kicinski 	/* CCK Tx Control */
32c869f77dSJakub Kicinski 	{ 178, 0xff },
33c869f77dSJakub Kicinski 	/* AGC/Sync controls */
34c869f77dSJakub Kicinski 	{  66, 0x14 },	{  68, 0x8b },	{  69, 0x12 },	{  70, 0x09 },
35c869f77dSJakub Kicinski 	{  73, 0x11 },	{  75, 0x60 },	{  76, 0x44 },	{  84, 0x9a },
36c869f77dSJakub Kicinski 	{  86, 0x38 },	{  91, 0x07 },	{  92, 0x02 },
37c869f77dSJakub Kicinski 	/* Rx Path Controls */
38c869f77dSJakub Kicinski 	{  99, 0x50 },	{ 101, 0x00 },	{ 103, 0xc0 },	{ 104, 0x92 },
39c869f77dSJakub Kicinski 	{ 105, 0x3c },	{ 106, 0x03 },	{ 128, 0x12 },
40c869f77dSJakub Kicinski 	/* Change RXWI content: Gain Report */
41c869f77dSJakub Kicinski 	{ 142, 0x04 },	{ 143, 0x37 },
42c869f77dSJakub Kicinski 	/* Change RXWI content: Antenna Report */
43c869f77dSJakub Kicinski 	{ 142, 0x03 },	{ 143, 0x99 },
44c869f77dSJakub Kicinski 	/* Calibration Index Register */
45c869f77dSJakub Kicinski 	/* CCK Receiver Control */
46c869f77dSJakub Kicinski 	{ 160, 0xeb },	{ 161, 0xc4 },	{ 162, 0x77 },	{ 163, 0xf9 },
47c869f77dSJakub Kicinski 	{ 164, 0x88 },	{ 165, 0x80 },	{ 166, 0xff },	{ 167, 0xe4 },
48c869f77dSJakub Kicinski 	/* Added AGC controls - these AGC/GLRT registers are accessed
49c869f77dSJakub Kicinski 	 * through R195 and R196.
50c869f77dSJakub Kicinski 	 */
51c869f77dSJakub Kicinski 	{ 195, 0x00 },	{ 196, 0x00 },
52c869f77dSJakub Kicinski 	{ 195, 0x01 },	{ 196, 0x04 },
53c869f77dSJakub Kicinski 	{ 195, 0x02 },	{ 196, 0x20 },
54c869f77dSJakub Kicinski 	{ 195, 0x03 },	{ 196, 0x0a },
55c869f77dSJakub Kicinski 	{ 195, 0x06 },	{ 196, 0x16 },
56c869f77dSJakub Kicinski 	{ 195, 0x07 },	{ 196, 0x05 },
57c869f77dSJakub Kicinski 	{ 195, 0x08 },	{ 196, 0x37 },
58c869f77dSJakub Kicinski 	{ 195, 0x0a },	{ 196, 0x15 },
59c869f77dSJakub Kicinski 	{ 195, 0x0b },	{ 196, 0x17 },
60c869f77dSJakub Kicinski 	{ 195, 0x0c },	{ 196, 0x06 },
61c869f77dSJakub Kicinski 	{ 195, 0x0d },	{ 196, 0x09 },
62c869f77dSJakub Kicinski 	{ 195, 0x0e },	{ 196, 0x05 },
63c869f77dSJakub Kicinski 	{ 195, 0x0f },	{ 196, 0x09 },
64c869f77dSJakub Kicinski 	{ 195, 0x10 },	{ 196, 0x20 },
65c869f77dSJakub Kicinski 	{ 195, 0x20 },	{ 196, 0x17 },
66c869f77dSJakub Kicinski 	{ 195, 0x21 },	{ 196, 0x06 },
67c869f77dSJakub Kicinski 	{ 195, 0x22 },	{ 196, 0x09 },
68c869f77dSJakub Kicinski 	{ 195, 0x23 },	{ 196, 0x17 },
69c869f77dSJakub Kicinski 	{ 195, 0x24 },	{ 196, 0x06 },
70c869f77dSJakub Kicinski 	{ 195, 0x25 },	{ 196, 0x09 },
71c869f77dSJakub Kicinski 	{ 195, 0x26 },	{ 196, 0x17 },
72c869f77dSJakub Kicinski 	{ 195, 0x27 },	{ 196, 0x06 },
73c869f77dSJakub Kicinski 	{ 195, 0x28 },	{ 196, 0x09 },
74c869f77dSJakub Kicinski 	{ 195, 0x29 },	{ 196, 0x05 },
75c869f77dSJakub Kicinski 	{ 195, 0x2a },	{ 196, 0x09 },
76c869f77dSJakub Kicinski 	{ 195, 0x80 },	{ 196, 0x8b },
77c869f77dSJakub Kicinski 	{ 195, 0x81 },	{ 196, 0x12 },
78c869f77dSJakub Kicinski 	{ 195, 0x82 },	{ 196, 0x09 },
79c869f77dSJakub Kicinski 	{ 195, 0x83 },	{ 196, 0x17 },
80c869f77dSJakub Kicinski 	{ 195, 0x84 },	{ 196, 0x11 },
81c869f77dSJakub Kicinski 	{ 195, 0x85 },	{ 196, 0x00 },
82c869f77dSJakub Kicinski 	{ 195, 0x86 },	{ 196, 0x00 },
83c869f77dSJakub Kicinski 	{ 195, 0x87 },	{ 196, 0x18 },
84c869f77dSJakub Kicinski 	{ 195, 0x88 },	{ 196, 0x60 },
85c869f77dSJakub Kicinski 	{ 195, 0x89 },	{ 196, 0x44 },
86c869f77dSJakub Kicinski 	{ 195, 0x8a },	{ 196, 0x8b },
87c869f77dSJakub Kicinski 	{ 195, 0x8b },	{ 196, 0x8b },
88c869f77dSJakub Kicinski 	{ 195, 0x8c },	{ 196, 0x8b },
89c869f77dSJakub Kicinski 	{ 195, 0x8d },	{ 196, 0x8b },
90c869f77dSJakub Kicinski 	{ 195, 0x8e },	{ 196, 0x09 },
91c869f77dSJakub Kicinski 	{ 195, 0x8f },	{ 196, 0x09 },
92c869f77dSJakub Kicinski 	{ 195, 0x90 },	{ 196, 0x09 },
93c869f77dSJakub Kicinski 	{ 195, 0x91 },	{ 196, 0x09 },
94c869f77dSJakub Kicinski 	{ 195, 0x92 },	{ 196, 0x11 },
95c869f77dSJakub Kicinski 	{ 195, 0x93 },	{ 196, 0x11 },
96c869f77dSJakub Kicinski 	{ 195, 0x94 },	{ 196, 0x11 },
97c869f77dSJakub Kicinski 	{ 195, 0x95 },	{ 196, 0x11 },
98c869f77dSJakub Kicinski 	/* PPAD */
99c869f77dSJakub Kicinski 	{  47, 0x80 },	{  60, 0x80 },	{ 150, 0xd2 },	{ 151, 0x32 },
100c869f77dSJakub Kicinski 	{ 152, 0x23 },	{ 153, 0x41 },	{ 154, 0x00 },	{ 155, 0x4f },
101c869f77dSJakub Kicinski 	{ 253, 0x7e },	{ 195, 0x30 },	{ 196, 0x32 },	{ 195, 0x31 },
102c869f77dSJakub Kicinski 	{ 196, 0x23 },	{ 195, 0x32 },	{ 196, 0x45 },	{ 195, 0x35 },
103c869f77dSJakub Kicinski 	{ 196, 0x4a },	{ 195, 0x36 },	{ 196, 0x5a },	{ 195, 0x37 },
104c869f77dSJakub Kicinski 	{ 196, 0x5a },
105c869f77dSJakub Kicinski };
106c869f77dSJakub Kicinski 
107c869f77dSJakub Kicinski static const struct mt76_reg_pair mac_common_vals[] = {
108c869f77dSJakub Kicinski 	{ MT_LEGACY_BASIC_RATE,		0x0000013f },
109c869f77dSJakub Kicinski 	{ MT_HT_BASIC_RATE,		0x00008003 },
110c869f77dSJakub Kicinski 	{ MT_MAC_SYS_CTRL,		0x00000000 },
111c869f77dSJakub Kicinski 	{ MT_RX_FILTR_CFG,		0x00017f97 },
112c869f77dSJakub Kicinski 	{ MT_BKOFF_SLOT_CFG,		0x00000209 },
113c869f77dSJakub Kicinski 	{ MT_TX_SW_CFG0,		0x00000000 },
114c869f77dSJakub Kicinski 	{ MT_TX_SW_CFG1,		0x00080606 },
115c869f77dSJakub Kicinski 	{ MT_TX_LINK_CFG,		0x00001020 },
116c869f77dSJakub Kicinski 	{ MT_TX_TIMEOUT_CFG,		0x000a2090 },
117c869f77dSJakub Kicinski 	{ MT_MAX_LEN_CFG,		0x00003fff },
118c869f77dSJakub Kicinski 	{ MT_PBF_TX_MAX_PCNT,		0x1fbf1f1f },
119c869f77dSJakub Kicinski 	{ MT_PBF_RX_MAX_PCNT,		0x0000009f },
120c869f77dSJakub Kicinski 	{ MT_TX_RETRY_CFG,		0x47d01f0f },
121c869f77dSJakub Kicinski 	{ MT_AUTO_RSP_CFG,		0x00000013 },
122c869f77dSJakub Kicinski 	{ MT_CCK_PROT_CFG,		0x05740003 },
123c869f77dSJakub Kicinski 	{ MT_OFDM_PROT_CFG,		0x05740003 },
124c869f77dSJakub Kicinski 	{ MT_MM40_PROT_CFG,		0x03f44084 },
125c869f77dSJakub Kicinski 	{ MT_GF20_PROT_CFG,		0x01744004 },
126c869f77dSJakub Kicinski 	{ MT_GF40_PROT_CFG,		0x03f44084 },
127c869f77dSJakub Kicinski 	{ MT_MM20_PROT_CFG,		0x01744004 },
128c869f77dSJakub Kicinski 	{ MT_TXOP_CTRL_CFG,		0x0000583f },
129c869f77dSJakub Kicinski 	{ MT_TX_RTS_CFG,		0x01092b20 },
130c869f77dSJakub Kicinski 	{ MT_EXP_ACK_TIME,		0x002400ca },
131c869f77dSJakub Kicinski 	{ MT_TXOP_HLDR_ET,		0x00000002 },
132c869f77dSJakub Kicinski 	{ MT_XIFS_TIME_CFG,		0x33a41010 },
133c869f77dSJakub Kicinski 	{ MT_PWR_PIN_CFG,		0x00000000 },
134a9eab62dSLorenzo Bianconi 	{ MT_PN_PAD_MODE,		0x00000001 },
135c869f77dSJakub Kicinski };
136c869f77dSJakub Kicinski 
137c869f77dSJakub Kicinski static const struct mt76_reg_pair mac_chip_vals[] = {
138c869f77dSJakub Kicinski 	{ MT_TSO_CTRL,			0x00006050 },
139c869f77dSJakub Kicinski 	{ MT_BCN_OFFSET(0),		0x18100800 },
140c869f77dSJakub Kicinski 	{ MT_BCN_OFFSET(1),		0x38302820 },
141c869f77dSJakub Kicinski 	{ MT_PBF_SYS_CTRL,		0x00080c00 },
142c869f77dSJakub Kicinski 	{ MT_PBF_CFG,			0x7f723c1f },
143c869f77dSJakub Kicinski 	{ MT_FCE_PSE_CTRL,		0x00000001 },
144c869f77dSJakub Kicinski 	{ MT_PAUSE_ENABLE_CONTROL1,	0x00000000 },
145c869f77dSJakub Kicinski 	{ MT_TX0_RF_GAIN_CORR,		0x003b0005 },
146c869f77dSJakub Kicinski 	{ MT_TX0_RF_GAIN_ATTEN,		0x00006900 },
147c869f77dSJakub Kicinski 	{ MT_TX0_BB_GAIN_ATTEN,		0x00000400 },
148c869f77dSJakub Kicinski 	{ MT_TX_ALC_VGA3,		0x00060006 },
149c869f77dSJakub Kicinski 	{ MT_TX_SW_CFG0,		0x00000402 },
150c869f77dSJakub Kicinski 	{ MT_TX_SW_CFG1,		0x00000000 },
151c869f77dSJakub Kicinski 	{ MT_TX_SW_CFG2,		0x00000000 },
152c869f77dSJakub Kicinski 	{ MT_HEADER_TRANS_CTRL_REG,	0x00000000 },
153c869f77dSJakub Kicinski 	{ MT_FCE_CSO,			0x0000030f },
154c869f77dSJakub Kicinski 	{ MT_FCE_PARAMETERS,		0x00256f0f },
155c869f77dSJakub Kicinski };
156c869f77dSJakub Kicinski 
157c869f77dSJakub Kicinski #endif
158