1*59d8a77dSDmitry Borisov /*
2*59d8a77dSDmitry Borisov  * PROJECT:     ReactOS DC21x4 Driver
3*59d8a77dSDmitry Borisov  * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4*59d8a77dSDmitry Borisov  * PURPOSE:     EEPROM data for boards without the standard SROM Format
5*59d8a77dSDmitry Borisov  * COPYRIGHT:   Copyright 2023 Dmitry Borisov <di.sean@protonmail.com>
6*59d8a77dSDmitry Borisov  */
7*59d8a77dSDmitry Borisov 
8*59d8a77dSDmitry Borisov /* Adapted from the Linux tulip driver written by Donald Becker */
9*59d8a77dSDmitry Borisov 
10*59d8a77dSDmitry Borisov /* INCLUDES *******************************************************************/
11*59d8a77dSDmitry Borisov 
12*59d8a77dSDmitry Borisov #include "dc21x4.h"
13*59d8a77dSDmitry Borisov 
14*59d8a77dSDmitry Borisov /* GLOBALS ********************************************************************/
15*59d8a77dSDmitry Borisov 
16*59d8a77dSDmitry Borisov /* Asante */
17*59d8a77dSDmitry Borisov static DC_PG_DATA UCHAR SRompLeafAsante[] =
18*59d8a77dSDmitry Borisov {
19*59d8a77dSDmitry Borisov     0x00, 0x00, 0x94,
20*59d8a77dSDmitry Borisov 
21*59d8a77dSDmitry Borisov     0x00, 0x08, // Default Autoselect
22*59d8a77dSDmitry Borisov     0x00,       // GPIO direction
23*59d8a77dSDmitry Borisov     0x01,       // 1 block
24*59d8a77dSDmitry Borisov 
25*59d8a77dSDmitry Borisov     0x80 + 12,  // Extended block, 12 bytes
26*59d8a77dSDmitry Borisov     0x01,       // MII
27*59d8a77dSDmitry Borisov     0x00,       // PHY #0
28*59d8a77dSDmitry Borisov     0x00,       // GPIO stream length
29*59d8a77dSDmitry Borisov     0x00,       // Reset stream length
30*59d8a77dSDmitry Borisov     0x00, 0x78, // Capabilities
31*59d8a77dSDmitry Borisov     0xE0, 0x01, // Advertisement
32*59d8a77dSDmitry Borisov     0x00, 0x50, // FDX
33*59d8a77dSDmitry Borisov     0x00, 0x18, // TTM
34*59d8a77dSDmitry Borisov };
35*59d8a77dSDmitry Borisov 
36*59d8a77dSDmitry Borisov /* SMC 9332DST */
37*59d8a77dSDmitry Borisov static DC_PG_DATA UCHAR SRompLeaf9332[] =
38*59d8a77dSDmitry Borisov {
39*59d8a77dSDmitry Borisov     0x00, 0x00, 0xC0,
40*59d8a77dSDmitry Borisov 
41*59d8a77dSDmitry Borisov     0x00, 0x08, // Default Autoselect
42*59d8a77dSDmitry Borisov     0x1F,       // GPIO direction
43*59d8a77dSDmitry Borisov     0x04,       // 4 blocks
44*59d8a77dSDmitry Borisov 
45*59d8a77dSDmitry Borisov     0x00,       // GPR 0
46*59d8a77dSDmitry Borisov     0x00,       // GPIO data
47*59d8a77dSDmitry Borisov     0x9E, 0x00, // Command 0x009E
48*59d8a77dSDmitry Borisov 
49*59d8a77dSDmitry Borisov     0x04,       // GPR 4
50*59d8a77dSDmitry Borisov     0x00,       // GPIO data
51*59d8a77dSDmitry Borisov     0x9E, 0x00, // Command 0x009E
52*59d8a77dSDmitry Borisov     0x03,       // GPR 3
53*59d8a77dSDmitry Borisov     0x09,       // GPIO data
54*59d8a77dSDmitry Borisov     0x6D, 0x00, // Command 0x006D
55*59d8a77dSDmitry Borisov 
56*59d8a77dSDmitry Borisov     0x05,       // GPR 5
57*59d8a77dSDmitry Borisov     0x09,       // GPIO data
58*59d8a77dSDmitry Borisov     0x6D, 0x00, // Command 0x006D
59*59d8a77dSDmitry Borisov };
60*59d8a77dSDmitry Borisov 
61*59d8a77dSDmitry Borisov /* Cogent EM100 */
62*59d8a77dSDmitry Borisov static DC_PG_DATA UCHAR SRompLeafEm100[] =
63*59d8a77dSDmitry Borisov {
64*59d8a77dSDmitry Borisov     0x00, 0x00, 0x92,
65*59d8a77dSDmitry Borisov 
66*59d8a77dSDmitry Borisov     0x00, 0x08, // Default Autoselect
67*59d8a77dSDmitry Borisov     0x3F,       // GPIO direction
68*59d8a77dSDmitry Borisov     0x06,       // 6 blocks
69*59d8a77dSDmitry Borisov 
70*59d8a77dSDmitry Borisov     0x07,       // GPR 7
71*59d8a77dSDmitry Borisov     0x01,       // GPIO data
72*59d8a77dSDmitry Borisov     0x21, 0x80, // Command 0x8021
73*59d8a77dSDmitry Borisov 
74*59d8a77dSDmitry Borisov     0x08,       // GPR 8
75*59d8a77dSDmitry Borisov     0x01,       // GPIO data
76*59d8a77dSDmitry Borisov     0x21, 0x80, // Command 0x8021
77*59d8a77dSDmitry Borisov 
78*59d8a77dSDmitry Borisov     0x00,       // GPR 0
79*59d8a77dSDmitry Borisov     0x01,       // GPIO data
80*59d8a77dSDmitry Borisov     0x9E, 0x00, // Command 0x009E
81*59d8a77dSDmitry Borisov 
82*59d8a77dSDmitry Borisov     0x04,       // GPR 4
83*59d8a77dSDmitry Borisov     0x01,       // GPIO data
84*59d8a77dSDmitry Borisov     0x9E, 0x00, // Command 0x009E
85*59d8a77dSDmitry Borisov 
86*59d8a77dSDmitry Borisov     0x03,       // GPR 3
87*59d8a77dSDmitry Borisov     0x01,       // GPIO data
88*59d8a77dSDmitry Borisov     0x6D, 0x00, // Command 0x006D
89*59d8a77dSDmitry Borisov 
90*59d8a77dSDmitry Borisov     0x05,       // GPR 5
91*59d8a77dSDmitry Borisov     0x01,       // GPIO data
92*59d8a77dSDmitry Borisov     0x6D, 0x00, // Command 0x006D
93*59d8a77dSDmitry Borisov };
94*59d8a77dSDmitry Borisov 
95*59d8a77dSDmitry Borisov /* Maxtech NX-110 */
96*59d8a77dSDmitry Borisov static DC_PG_DATA UCHAR SRompLeafNx110[] =
97*59d8a77dSDmitry Borisov {
98*59d8a77dSDmitry Borisov     0x00, 0x00, 0xE8,
99*59d8a77dSDmitry Borisov 
100*59d8a77dSDmitry Borisov     0x00, 0x08, // Default Autoselect
101*59d8a77dSDmitry Borisov     0x13,       // GPIO direction
102*59d8a77dSDmitry Borisov     0x05,       // 5 blocks
103*59d8a77dSDmitry Borisov 
104*59d8a77dSDmitry Borisov     0x01,       // GPR 1
105*59d8a77dSDmitry Borisov     0x10,       // GPIO data
106*59d8a77dSDmitry Borisov     0x9E, 0x00, // Command 0x009E
107*59d8a77dSDmitry Borisov 
108*59d8a77dSDmitry Borisov     0x00,       // GPR 0
109*59d8a77dSDmitry Borisov     0x00,       // GPIO data
110*59d8a77dSDmitry Borisov     0x9E, 0x00, // Command 0x009E
111*59d8a77dSDmitry Borisov 
112*59d8a77dSDmitry Borisov     0x04,       // GPR 4
113*59d8a77dSDmitry Borisov     0x00,       // GPIO data
114*59d8a77dSDmitry Borisov     0x9E, 0x00, // Command 0x009E
115*59d8a77dSDmitry Borisov 
116*59d8a77dSDmitry Borisov     0x03,       // GPR 3
117*59d8a77dSDmitry Borisov     0x03,       // GPIO data
118*59d8a77dSDmitry Borisov     0x6D, 0x00, // Command 0x006D
119*59d8a77dSDmitry Borisov 
120*59d8a77dSDmitry Borisov     0x05,       // GPR 5
121*59d8a77dSDmitry Borisov     0x03,       // GPIO data
122*59d8a77dSDmitry Borisov     0x6D, 0x00, // Command 0x006D
123*59d8a77dSDmitry Borisov };
124*59d8a77dSDmitry Borisov 
125*59d8a77dSDmitry Borisov /* Accton EN1207 */
126*59d8a77dSDmitry Borisov static DC_PG_DATA UCHAR SRompLeafEn1207[] =
127*59d8a77dSDmitry Borisov {
128*59d8a77dSDmitry Borisov     0x00, 0x00, 0xE8,
129*59d8a77dSDmitry Borisov 
130*59d8a77dSDmitry Borisov     0x00, 0x08, // Default Autoselect
131*59d8a77dSDmitry Borisov     0x1F,       // GPIO direction
132*59d8a77dSDmitry Borisov     0x05,       // 5 blocks
133*59d8a77dSDmitry Borisov 
134*59d8a77dSDmitry Borisov     0x01,       // GPR 1
135*59d8a77dSDmitry Borisov     0x1B,       // GPIO data
136*59d8a77dSDmitry Borisov     0x00, 0x00, // Command 0x0000
137*59d8a77dSDmitry Borisov 
138*59d8a77dSDmitry Borisov     0x00,       // GPR 0
139*59d8a77dSDmitry Borisov     0x0B,       // GPIO data
140*59d8a77dSDmitry Borisov     0x9E, 0x00, // Command 0x009E
141*59d8a77dSDmitry Borisov 
142*59d8a77dSDmitry Borisov     0x04,       // GPR 4
143*59d8a77dSDmitry Borisov     0x0B,       // GPIO data
144*59d8a77dSDmitry Borisov     0x9E, 0x00, // Command 0x009E
145*59d8a77dSDmitry Borisov 
146*59d8a77dSDmitry Borisov     0x03,       // GPR 3
147*59d8a77dSDmitry Borisov     0x1B,       // GPIO data
148*59d8a77dSDmitry Borisov     0x6D, 0x00, // Command 0x006D
149*59d8a77dSDmitry Borisov 
150*59d8a77dSDmitry Borisov     0x05,       // GPR 5
151*59d8a77dSDmitry Borisov     0x1B,       // GPIO data
152*59d8a77dSDmitry Borisov     0x6D, 0x00, // Command 0x006D
153*59d8a77dSDmitry Borisov };
154*59d8a77dSDmitry Borisov 
155*59d8a77dSDmitry Borisov /* NetWinder */
156*59d8a77dSDmitry Borisov static DC_PG_DATA UCHAR SRompLeafNetWinder[] =
157*59d8a77dSDmitry Borisov {
158*59d8a77dSDmitry Borisov     0x00, 0x10, 0x57,
159*59d8a77dSDmitry Borisov 
160*59d8a77dSDmitry Borisov     0x00, 0x08, // Default Autoselect
161*59d8a77dSDmitry Borisov     0x01,       // 1 block
162*59d8a77dSDmitry Borisov 
163*59d8a77dSDmitry Borisov     0x80 + 21,  // Extended block, 21 bytes
164*59d8a77dSDmitry Borisov     0x03,       // MII
165*59d8a77dSDmitry Borisov     0x01,       // PHY #1
166*59d8a77dSDmitry Borisov     0x00,       // GPIO stream length
167*59d8a77dSDmitry Borisov     0x03,       // Reset stream length
168*59d8a77dSDmitry Borisov     0x21, 0x08,
169*59d8a77dSDmitry Borisov     0x00, 0x00,
170*59d8a77dSDmitry Borisov     0x01, 0x00,
171*59d8a77dSDmitry Borisov     0x00, 0x00, // Capabilities
172*59d8a77dSDmitry Borisov     0xE1, 0x01, // Advertisement
173*59d8a77dSDmitry Borisov     0x00, 0x00, // FDX
174*59d8a77dSDmitry Borisov     0x00, 0x00, // TTM
175*59d8a77dSDmitry Borisov     0x00,       // PHY cannot be unplugged
176*59d8a77dSDmitry Borisov };
177*59d8a77dSDmitry Borisov 
178*59d8a77dSDmitry Borisov /* Cobalt Microserver */
179*59d8a77dSDmitry Borisov static DC_PG_DATA UCHAR SRompLeafCobaltMicroserver[] =
180*59d8a77dSDmitry Borisov {
181*59d8a77dSDmitry Borisov     0x00, 0x10, 0xE0,
182*59d8a77dSDmitry Borisov 
183*59d8a77dSDmitry Borisov     0x00, 0x08, // Default Autoselect
184*59d8a77dSDmitry Borisov     0x01,       // 1 block
185*59d8a77dSDmitry Borisov 
186*59d8a77dSDmitry Borisov     0x80 + 21,  // Extended block, 21 bytes
187*59d8a77dSDmitry Borisov     0x03,       // MII
188*59d8a77dSDmitry Borisov     0x00,       // PHY #0
189*59d8a77dSDmitry Borisov     0x00,       // GPIO stream length
190*59d8a77dSDmitry Borisov     0x04,       // Reset stream length
191*59d8a77dSDmitry Borisov     0x01, 0x08, // Set control mode, GP0 output
192*59d8a77dSDmitry Borisov     0x00, 0x00, // Drive GP0 Low (RST is active low)
193*59d8a77dSDmitry Borisov     0x00, 0x08, // Control mode, GP0 input (undriven)
194*59d8a77dSDmitry Borisov     0x00, 0x00, // Clear control mode
195*59d8a77dSDmitry Borisov     0x00, 0x78, // Capabilities: 100TX FDX + HDX, 10bT FDX + HDX
196*59d8a77dSDmitry Borisov     0xE0, 0x01, // Advertise all above
197*59d8a77dSDmitry Borisov     0x00, 0x50, // FDX all above
198*59d8a77dSDmitry Borisov     0x00, 0x18, // Set fast TTM in 100bt modes
199*59d8a77dSDmitry Borisov     0x00,       // PHY cannot be unplugged
200*59d8a77dSDmitry Borisov };
201*59d8a77dSDmitry Borisov 
202*59d8a77dSDmitry Borisov #if DBG
203*59d8a77dSDmitry Borisov #define DEFINE_BOARD(Leaf, Name) { Name, Leaf, sizeof(Leaf) - 3 /* OUI (3 bytes) */}
204*59d8a77dSDmitry Borisov #else
205*59d8a77dSDmitry Borisov #define DEFINE_BOARD(Leaf, Name) { Leaf, sizeof(Leaf) - 3 }
206*59d8a77dSDmitry Borisov #endif
207*59d8a77dSDmitry Borisov 
208*59d8a77dSDmitry Borisov DC_PG_DATA
209*59d8a77dSDmitry Borisov DC_SROM_REPAIR_ENTRY SRompRepairData[] =
210*59d8a77dSDmitry Borisov {
211*59d8a77dSDmitry Borisov     DEFINE_BOARD(SRompLeafAsante, "Asante"),
212*59d8a77dSDmitry Borisov     DEFINE_BOARD(SRompLeaf9332, "SMC 9332DST"),
213*59d8a77dSDmitry Borisov     DEFINE_BOARD(SRompLeafEm100, "Cogent EM100"),
214*59d8a77dSDmitry Borisov     DEFINE_BOARD(SRompLeafNx110, "Maxtech NX-110"),
215*59d8a77dSDmitry Borisov     DEFINE_BOARD(SRompLeafEn1207, "Accton EN1207"), // Must be defined after the NX-110
216*59d8a77dSDmitry Borisov     DEFINE_BOARD(SRompLeafNetWinder, "NetWinder"),
217*59d8a77dSDmitry Borisov     DEFINE_BOARD(SRompLeafCobaltMicroserver, "Cobalt Microserver"),
218*59d8a77dSDmitry Borisov     DEFINE_BOARD(NULL, NULL),
219*59d8a77dSDmitry Borisov };
220