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
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
|
From 496cdb9ccfe8908ec0fe7f703ce6f25e5abf1c18 Mon Sep 17 00:00:00 2001
From: Mate Kukri <kukri.mate@gmail.com>
Date: Thu, 24 Oct 2024 18:05:19 +0100
Subject: [PATCH 1/5] mb/dell: OptiPlex 3050 Micro port (Intel KabyLake)
- Boots Linux 6.11 (Debian)
- GRUB and SeaBIOS payloads work
- SMSC SCH5553 SIO/EC
+ Serial port works
+ PWM fan control works
- Realtek Gigabit LAN works
- WiFi slot works
- NVMe SSD slot works
- Extra: LPSS UART0
+ Stock FW sets undocumented power gating bit, RTC battery needs to
be pulled for it to work.
+ Signals exposed on test points on the back of the board.
FIXME: add documentation about this
- Needs 'deguard' to bypass BootGuard
+ See https://review.coreboot.org/plugins/gitiles/deguard
- Audio works
- All USB ports work
- Currently limited to the Micro form factor, but others are very
similar
- HDA verbs and VBT by Leah Rowe
Change-Id: I8d443e39ee684a4eaa19c835a945cfe569c051e2
Signed-off-by: Mate Kukri <kukri.mate@gmail.com>
---
src/mainboard/dell/optiplex_3050/Kconfig | 37 ++
src/mainboard/dell/optiplex_3050/Kconfig.name | 4 +
src/mainboard/dell/optiplex_3050/Makefile.mk | 12 +
src/mainboard/dell/optiplex_3050/acpi/ec.asl | 3 +
.../dell/optiplex_3050/acpi/superio.asl | 3 +
.../dell/optiplex_3050/board_info.txt | 7 +
src/mainboard/dell/optiplex_3050/bootblock.c | 107 ++++
src/mainboard/dell/optiplex_3050/cmos.default | 5 +
src/mainboard/dell/optiplex_3050/cmos.layout | 54 ++
src/mainboard/dell/optiplex_3050/data.vbt | Bin 0 -> 4300 bytes
.../dell/optiplex_3050/devicetree.cb | 103 ++++
src/mainboard/dell/optiplex_3050/dsdt.asl | 27 +
.../dell/optiplex_3050/gma-mainboard.ads | 19 +
src/mainboard/dell/optiplex_3050/hda_verb.c | 90 +++
.../dell/optiplex_3050/include/early_gpio.h | 11 +
.../dell/optiplex_3050/include/gpio.h | 241 +++++++++
src/mainboard/dell/optiplex_3050/ramstage.c | 512 ++++++++++++++++++
src/mainboard/dell/optiplex_3050/romstage.c | 18 +
src/mainboard/dell/optiplex_3050/sch5555_ec.c | 54 ++
src/mainboard/dell/optiplex_3050/sch5555_ec.h | 10 +
20 files changed, 1317 insertions(+)
create mode 100644 src/mainboard/dell/optiplex_3050/Kconfig
create mode 100644 src/mainboard/dell/optiplex_3050/Kconfig.name
create mode 100644 src/mainboard/dell/optiplex_3050/Makefile.mk
create mode 100644 src/mainboard/dell/optiplex_3050/acpi/ec.asl
create mode 100644 src/mainboard/dell/optiplex_3050/acpi/superio.asl
create mode 100644 src/mainboard/dell/optiplex_3050/board_info.txt
create mode 100644 src/mainboard/dell/optiplex_3050/bootblock.c
create mode 100644 src/mainboard/dell/optiplex_3050/cmos.default
create mode 100644 src/mainboard/dell/optiplex_3050/cmos.layout
create mode 100644 src/mainboard/dell/optiplex_3050/data.vbt
create mode 100644 src/mainboard/dell/optiplex_3050/devicetree.cb
create mode 100644 src/mainboard/dell/optiplex_3050/dsdt.asl
create mode 100644 src/mainboard/dell/optiplex_3050/gma-mainboard.ads
create mode 100644 src/mainboard/dell/optiplex_3050/hda_verb.c
create mode 100644 src/mainboard/dell/optiplex_3050/include/early_gpio.h
create mode 100644 src/mainboard/dell/optiplex_3050/include/gpio.h
create mode 100644 src/mainboard/dell/optiplex_3050/ramstage.c
create mode 100644 src/mainboard/dell/optiplex_3050/romstage.c
create mode 100644 src/mainboard/dell/optiplex_3050/sch5555_ec.c
create mode 100644 src/mainboard/dell/optiplex_3050/sch5555_ec.h
diff --git a/src/mainboard/dell/optiplex_3050/Kconfig b/src/mainboard/dell/optiplex_3050/Kconfig
new file mode 100644
index 0000000000..6c8e72956e
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/Kconfig
@@ -0,0 +1,37 @@
+## SPDX-License-Identifier: GPL-2.0-only
+
+if BOARD_DELL_OPTIPLEX_3050
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select BOARD_ROMSIZE_KB_16384
+ select HAVE_ACPI_RESUME
+ select HAVE_ACPI_TABLES
+ select HAVE_CMOS_DEFAULT
+ select HAVE_OPTION_TABLE
+ select INTEL_GMA_ADD_VBT
+ select INTEL_GMA_HAVE_VBT
+ select MAINBOARD_HAS_LIBGFXINIT
+ select MAINBOARD_SUPPORTS_KABYLAKE_CPU
+ select MAINBOARD_SUPPORTS_SKYLAKE_CPU
+ select SKYLAKE_SOC_PCH_H
+ select SOC_INTEL_COMMON_BLOCK_HDA_VERB
+ select SOC_INTEL_KABYLAKE
+ select SUPERIO_SMSC_SCH555x
+
+config CBFS_SIZE
+ default 0x900000
+
+config MAINBOARD_DIR
+ default "dell/optiplex_3050"
+
+config MAINBOARD_PART_NUMBER
+ default "OptiPlex 3050 Micro"
+
+config INTEL_GMA_VBT_FILE
+ default "src/mainboard/\$(MAINBOARDDIR)/data.vbt"
+
+config DIMM_SPD_SIZE
+ default 512 # DDR4
+
+endif
diff --git a/src/mainboard/dell/optiplex_3050/Kconfig.name b/src/mainboard/dell/optiplex_3050/Kconfig.name
new file mode 100644
index 0000000000..14eab7f52c
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/Kconfig.name
@@ -0,0 +1,4 @@
+## SPDX-License-Identifier: GPL-2.0-only
+
+config BOARD_DELL_OPTIPLEX_3050
+ bool "OptiPlex 3050 Micro"
diff --git a/src/mainboard/dell/optiplex_3050/Makefile.mk b/src/mainboard/dell/optiplex_3050/Makefile.mk
new file mode 100644
index 0000000000..0bd72fe691
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/Makefile.mk
@@ -0,0 +1,12 @@
+## SPDX-License-Identifier: GPL-2.0-only
+
+bootblock-y += bootblock.c
+bootblock-y += sch5555_ec.c
+
+romstage-y += romstage.c
+
+ramstage-y += ramstage.c
+ramstage-y += sch5555_ec.c
+ramstage-y += hda_verb.c
+
+ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
diff --git a/src/mainboard/dell/optiplex_3050/acpi/ec.asl b/src/mainboard/dell/optiplex_3050/acpi/ec.asl
new file mode 100644
index 0000000000..16990d45f4
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/acpi/ec.asl
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: CC-PDDC */
+
+/* Please update the license if adding licensable material. */
diff --git a/src/mainboard/dell/optiplex_3050/acpi/superio.asl b/src/mainboard/dell/optiplex_3050/acpi/superio.asl
new file mode 100644
index 0000000000..16990d45f4
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/acpi/superio.asl
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: CC-PDDC */
+
+/* Please update the license if adding licensable material. */
diff --git a/src/mainboard/dell/optiplex_3050/board_info.txt b/src/mainboard/dell/optiplex_3050/board_info.txt
new file mode 100644
index 0000000000..47a4a3a4f3
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/board_info.txt
@@ -0,0 +1,7 @@
+Category: desktop
+Board URL: https://www.dell.com/support/kbdoc/en-uk/000124265/dell-optiplex-3050-system-guide
+ROM package: SOIC-8
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: y
+Release year: 2017
diff --git a/src/mainboard/dell/optiplex_3050/bootblock.c b/src/mainboard/dell/optiplex_3050/bootblock.c
new file mode 100644
index 0000000000..10689c42a1
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/bootblock.c
@@ -0,0 +1,107 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <bootblock_common.h>
+#include <device/pnp_ops.h>
+#include <soc/gpio.h>
+#include <superio/smsc/sch555x/sch555x.h>
+#include "include/early_gpio.h"
+#include "sch5555_ec.h"
+
+struct ec_init_entry {
+ uint16_t addr;
+ uint8_t val;
+};
+
+static void bootblock_ec_init(void)
+{
+ /*
+ * Early EC init
+ */
+
+ static const struct ec_init_entry init_table1[] = {
+ {0x08cc, 0x11}, {0x08d0, 0x11}, {0x088c, 0x10}, {0x0890, 0x10},
+ {0x0894, 0x10}, {0x0898, 0x12}, {0x089c, 0x12}, {0x08a0, 0x10},
+ {0x08a4, 0x12}, {0x08a8, 0x10}, {0x0820, 0x12}, {0x0824, 0x12},
+ {0x0878, 0x12}, {0x0880, 0x12}, {0x0884, 0x12}, {0x08e0, 0x12},
+ {0x08e4, 0x12}, {0x083c, 0x10}, {0x0840, 0x10}, {0x0844, 0x10},
+ {0x0848, 0x10}, {0x084c, 0x10}, {0x0850, 0x10}, {0x0814, 0x11},
+ };
+
+ for (size_t i = 0; i < ARRAY_SIZE(init_table1); ++i)
+ sch5555_mbox_write(2, init_table1[i].addr, init_table1[i].val);
+
+ static const struct ec_init_entry init_table2[] = {
+ {0x0040, 0x00}, {0x00f8, 0x10}, {0x00f9, 0x00}, {0x00f0, 0x30},
+ {0x00fa, 0x00}, {0x00fb, 0x00}, {0x00ea, 0x00}, {0x00eb, 0x00},
+ {0x00ef, 0x7c}, {0x0005, 0x0f}, {0x0014, 0x01}, {0x0018, 0x2f},
+ {0x0019, 0x2f}, {0x001a, 0x2f}, {0x001b, 0x2f}, {0x01d8, 0x01},
+ {0x0040, 0x11},
+ };
+
+ for (size_t i = 0; i < ARRAY_SIZE(init_table2); ++i)
+ sch5555_mbox_write(1, init_table2[i].addr, init_table2[i].val);
+
+ sch5555_mbox_write(1, 0x000b, 0x01);
+ sch5555_mbox_write(4, 0x001a, 0x04);
+ sch5555_mbox_write(4, 0x0028, 0x18);
+ sch5555_mbox_write(4, 0x001a, 0x00);
+ sch5555_mbox_write(1, 0x000b, 0x03);
+
+ /*
+ * Early HWM init
+ */
+
+ sch5555_mbox_read(1, 0xcb);
+ sch5555_mbox_read(1, 0xb8);
+
+ static const struct ec_init_entry hwm_init_table[] = {
+ {0x02fc, 0xa0}, {0x02fd, 0x32}, {0x0005, 0x77}, {0x0019, 0x2f},
+ {0x001a, 0x2f}, {0x008a, 0x33}, {0x008b, 0x33}, {0x008c, 0x33},
+ {0x00ba, 0x10}, {0x00d1, 0xff}, {0x00d6, 0xff}, {0x00db, 0xff},
+ {0x0048, 0x00}, {0x0049, 0x00}, {0x007a, 0x00}, {0x007b, 0x00},
+ {0x007c, 0x00}, {0x0080, 0x00}, {0x0081, 0x00}, {0x0082, 0x00},
+ {0x0083, 0xbb}, {0x0084, 0xb0}, {0x01a1, 0x88}, {0x01a4, 0x80},
+ {0x0088, 0x00}, {0x0089, 0x00}, {0x00a0, 0x02}, {0x00a1, 0x02},
+ {0x00a2, 0x02}, {0x00a4, 0x04}, {0x00a5, 0x04}, {0x00a6, 0x04},
+ {0x00ab, 0x00}, {0x00ad, 0x3f}, {0x00b7, 0x07}, {0x0062, 0x50},
+ {0x0000, 0x46}, {0x0000, 0x50}, {0x0000, 0x46}, {0x0000, 0x50},
+ {0x0000, 0x46}, {0x0000, 0x98}, {0x0059, 0x98}, {0x0061, 0x7c},
+ {0x01bc, 0x00}, {0x01bd, 0x00}, {0x01bb, 0x00}, {0x0085, 0xdd},
+ {0x0086, 0xdd}, {0x0087, 0x07}, {0x0090, 0x82}, {0x0091, 0x5e},
+ {0x0095, 0x5d}, {0x0096, 0xa9}, {0x0097, 0x00}, {0x009b, 0x00},
+ {0x00ae, 0x86}, {0x00af, 0x86}, {0x00b3, 0x67}, {0x00c4, 0xff},
+ {0x00c5, 0xff}, {0x00c9, 0xff}, {0x0040, 0x01}, {0x02fc, 0x00},
+ {0x02b3, 0x9a}, {0x02b4, 0x05}, {0x02cc, 0x01}, {0x02d0, 0x4c},
+ {0x02d2, 0x01}, {0x02db, 0x01}, {0x006f, 0x01}, {0x0070, 0x02},
+ {0x0071, 0x03}, {0x018b, 0x03}, {0x018c, 0x03}, {0x0015, 0x33},
+ {0x018b, 0x00}, {0x018c, 0x00}, {0x02f8, 0x5e}, {0x02f9, 0x01},
+ };
+
+ for (size_t i = 0; i < ARRAY_SIZE(hwm_init_table); ++i)
+ sch5555_mbox_write(1, hwm_init_table[i].addr, hwm_init_table[i].val);
+}
+
+
+#define SCH555x_IOBASE 0x2e
+#define GLOBAL_DEV PNP_DEV(SCH555x_IOBASE, SCH555x_LDN_GLOBAL)
+#define SERIAL_DEV PNP_DEV(SCH555x_IOBASE, SCH555x_LDN_UART1)
+
+void bootblock_mainboard_early_init(void)
+{
+ gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table));
+
+ // Super I/O early init will map Runtime and EMI registers
+ sch555x_early_init(GLOBAL_DEV);
+
+ // Changes LED color among a few other things
+ outb(1, SCH555x_RUNTIME_IOBASE + SCH555x_RUNTIME_PME_STS);
+ outb(1, SCH555x_RUNTIME_IOBASE + SCH555x_RUNTIME_PME_EN);
+ outb(0xf, SCH555x_RUNTIME_IOBASE + SCH555x_RUNTIME_LED);
+ outb(1, SCH555x_RUNTIME_IOBASE + SCH555x_RUNTIME_UNK1);
+
+ // Perform bootblock EC initialization
+ bootblock_ec_init();
+
+ // Bootblock EC initialization is required for UART1 to work
+ sch555x_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
+}
diff --git a/src/mainboard/dell/optiplex_3050/cmos.default b/src/mainboard/dell/optiplex_3050/cmos.default
new file mode 100644
index 0000000000..79961f43d8
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/cmos.default
@@ -0,0 +1,5 @@
+## SPDX-License-Identifier: GPL-2.0-only
+
+boot_option=Fallback
+debug_level=Debug
+power_on_after_fail=Disable
diff --git a/src/mainboard/dell/optiplex_3050/cmos.layout b/src/mainboard/dell/optiplex_3050/cmos.layout
new file mode 100644
index 0000000000..54a5147b7d
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/cmos.layout
@@ -0,0 +1,54 @@
+## SPDX-License-Identifier: GPL-2.0-only
+
+# -----------------------------------------------------------------
+entries
+
+#start-bit length config config-ID name
+
+# -----------------------------------------------------------------
+0 120 r 0 reserved_memory
+
+# -----------------------------------------------------------------
+# RTC_BOOT_BYTE (coreboot hardcoded)
+384 1 e 4 boot_option
+388 4 h 0 reboot_counter
+
+# -----------------------------------------------------------------
+# coreboot config options: console
+395 4 e 6 debug_level
+
+# coreboot config options: southbridge
+409 2 e 7 power_on_after_fail
+
+# coreboot config options: bootloader
+#Used by ChromeOS:
+416 128 r 0 vbnv
+
+# coreboot config options: check sums
+984 16 h 0 check_sum
+
+# -----------------------------------------------------------------
+
+enumerations
+
+#ID value text
+1 0 Disable
+1 1 Enable
+4 0 Fallback
+4 1 Normal
+6 0 Emergency
+6 1 Alert
+6 2 Critical
+6 3 Error
+6 4 Warning
+6 5 Notice
+6 6 Info
+6 7 Debug
+6 8 Spew
+7 0 Disable
+7 1 Enable
+7 2 Keep
+# -----------------------------------------------------------------
+checksums
+
+checksum 392 415 984
diff --git a/src/mainboard/dell/optiplex_3050/data.vbt b/src/mainboard/dell/optiplex_3050/data.vbt
new file mode 100644
index 0000000000000000000000000000000000000000..6dc40cd99563bcd957ec2a9c4567e3b21e5d1d1f
GIT binary patch
literal 4300
zcmeHJZ)_A*5TD(>zi)T1ds~!pU>y<RuF$e~N-bJsuXmJ|7P*63&uGGx+#w{DmbQ?B
ze^_HpNECA))Sw}xiC;|p(!}^ljU+}T!9QpeKH4uPN;EMM;}_tZeY@?IBiNH@l!V#L
zn>X`jfBW9Nd2eS$e@7qg=y|L+*|P~<Du4l>Ybk24rH<}xJ9eg%eaW32z1vbf_%+-P
zC$uXU01ASzM2Q>g;@$hkii6SZG3@E+#eVw*w9N;N1g6_?YiB3s;_)?@>DbVf-r9}P
zO`Vx|jP%robSBQ#gsrAYO>p&IQpqWSxVK|yXmkvV`v!Im77N$TZXru*X!y{`-Y55r
zVKf!Pgkc!X2_qgyK4nY|jSRP7a&Qp0+diYXy*OGNIan;Ts7z%5ry$@FKoGo8XMq5h
z6OcC{V?x>l17U>+7I|RUgn|iuCftWGW>(Kf196=odH`0=A3;(GULp|y6Ks_T0R#_x
zlLt);9A0GWnQsLE?*|8{0RgE`gv2JC<6bXwubJ}!0Qv+3{3xJE9q#3H2<s&G0tf>5
z>@mL~p#5nF3*pl}^hKC<v1C31Ae!^M&^2;#l`=O_ZLQWF$7*Y}Uh$G>xt9(*`c-X6
zFkpAE5jIOv7?VVJPHKbYp3@KrBCHN-@DOp9_>7mqcf{Wl|3v&7@nvGak3pDtDe*nT
zYl+trr--)_KT146>^lIL%Ay5+{&h=mW!RCRdEk{8SSMWj3D+L{)!qr(URTPl<i;AB
za@p^PE9Ea6pj-}YuxDTr0>wf|yGUKG?B!CDGOpf7(oT__tC!2cJgEtK{*6}R$n1=r
z$PSguH+xU1hb?rHq(J+G2P}V^ryazPkEs%j0}In3b4gctpl8)ZC&3qS6o31yv0DC@
zBN6*5So*Vg*3aOq|DtfT{{PvtW2P<e%*HkB(yV?<-ipBd2rTP@b3v<wGk0i#{Bmcc
z@y0B7K0!Gt2Iyi?fd2i^HUB$v{Q!tv^fz~$94j}a>75FZ$;1Eo6%!)V*$4D5C>nt}
z7_D}&ricJyuY&X-!vUs`GWIOPx0wDOV;?d6f$4uRCdjx-*4N7{CF5RMe_CcQ%J`0~
ze<-uhWc)?e%Q6cpxK`1V3hPmDzoNgOuwx3otLUF7>?;L-S9HJ1!Ybac>fI{aq2eJ`
ze@SJpsrbICf1$GTDqdFgx)56u!i^z48)A=#)F$0)i8F!~4)H=KFrv`ilM@v#FA5q-
zZ`~^T%U!!Etw*TnvRA91loJ<5n5;vH=aymAq8i4g#?~Vu@R%z0b-pk{VF{Q?SZOpI
zZFLYDT8~J)KBGPNg2zT^r<&>dt1z12coq!P7_N5^Xb$wE-B-rFk(v<3F&oiLZ61P9
z^8O8kx7Uu(WFsrh-0{jBgc7g$6w^0d!yLLcn#Qi_glV3tAo!dLNa^?163N|n^-pD?
z(daC>dtpbi#Q&W%m0IHPOiO7pA89lVboYWH=_yh1N|ChuwX7oAZcPqP-%SWj_FFt3
zyd_?zD3jia8uH=I*yP#l#Bw9^#^N~y33zEtk*o#5XfjXdCkjSG)~N^WoRlb;h;B3|
zIfCjSc(I06T!_GA1{WKOk*chsMCXx5vW@41o#fZgYViT9VSih*nQN}>g+zCejX>9!
zZ{c$hGa+w5eO}YT_FH@}B)U(Dl-|zF&dk8R;^4yrPZe)YrI^k%j}0~VZ%*1PT98&h
z556thD#%T3IZc)NKi{(4RJn@8Dq3?JywFKA?WW585y(IR)(Ee|k5bDtz|lFnDY}0G
Ds8qe3
literal 0
HcmV?d00001
diff --git a/src/mainboard/dell/optiplex_3050/devicetree.cb b/src/mainboard/dell/optiplex_3050/devicetree.cb
new file mode 100644
index 0000000000..039709aa4a
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/devicetree.cb
@@ -0,0 +1,103 @@
+## SPDX-License-Identifier: GPL-2.0-only
+
+chip soc/intel/skylake
+ register "deep_sx_config" = "DSX_EN_WAKE_PIN | DSX_EN_LAN_WAKE_PIN"
+
+ # Enable Enhanced Intel SpeedStep
+ register "eist_enable" = "1"
+
+ device domain 0 on
+ device ref igpu on
+ register "PrimaryDisplay" = "Display_iGFX"
+ end
+
+ device ref south_xhci on
+ register "usb2_ports" = "{
+ [0] = USB2_PORT_MID(OC0), // Front panel (blue)
+ [1] = USB2_PORT_MID(OC0), // Front panel (blue)
+ [2] = USB2_PORT_MID(OC3), // Back panel (black)
+ [3] = USB2_PORT_MID(OC2), // Back panel (blue)
+ [4] = USB2_PORT_MID(OC1), // Back panel (blue)
+ [6] = USB2_PORT_MID(OC1), // Back panel (black)
+ [8] = USB2_PORT_MID(OC_SKIP), // WiFi slot
+ }"
+ register "usb3_ports" = "{
+ [0] = USB3_PORT_DEFAULT(OC0), // Front panel (blue)
+ [1] = USB3_PORT_DEFAULT(OC0), // Front panel (blue)
+ [2] = USB3_PORT_DEFAULT(OC2), // Back panel (blue)
+ [3] = USB3_PORT_DEFAULT(OC1), // Back panel (blue)
+ }"
+ end
+
+ # ME interface is 'off' to avoid HECI reset delay due to HAP
+ device ref heci1 off end
+
+ device ref sata on
+ register "SataSalpSupport" = "1"
+ register "SataPortsEnable[0]" = "1"
+ end
+
+ # M.2 SSD
+ device ref pcie_rp21 on
+ register "PcieRpEnable[20]" = "1"
+ register "PcieRpClkReqSupport[20]" = "1"
+ register "PcieRpClkReqNumber[20]" = "3"
+ register "PcieRpAdvancedErrorReporting[20]" = "1"
+ register "PcieRpLtrEnable[20]" = "1"
+ register "PcieRpClkSrcNumber[20]" = "3"
+ register "PcieRpHotPlug[20]" = "1"
+ end
+
+ # Realtek LAN
+ device ref pcie_rp5 on
+ register "PcieRpEnable[4]" = "1"
+ register "PcieRpClkReqSupport[4]" = "0"
+ register "PcieRpHotPlug[4]" = "0"
+ end
+
+ # M.2 WiFi
+ device ref pcie_rp8 on
+ register "PcieRpEnable[7]" = "1"
+ register "PcieRpClkReqSupport[7]" = "0"
+ register "PcieRpHotPlug[7]" = "1"
+ end
+
+ # UART0 is exposed on test points on the bottom of the board
+ device ref uart0 on
+ register "SerialIoDevMode[PchSerialIoIndexUart0]" = "PchSerialIoPci"
+ end
+
+ device ref lpc_espi on
+ register "serirq_mode" = "SERIRQ_CONTINUOUS"
+
+ # I/O decode for EMI/Runtime registers
+ register "gen1_dec" = "0x007c0a01"
+
+ # SCH5553
+ chip superio/smsc/sch555x
+ device pnp 2e.0 on # EMI
+ io 0x60 = 0xa00
+ end
+ device pnp 2e.1 off end # 8042
+ device pnp 2e.7 on # UART1
+ io 0x60 = 0x3f8
+ irq 0x0f = 2
+ irq 0x70 = 4
+ end
+ device pnp 2e.8 off end # UART2
+ device pnp 2e.c on # LPC interface
+ io 0x60 = 0x2e
+ end
+ device pnp 2e.a on # Runtime registers
+ io 0x60 = 0xa40
+ end
+ device pnp 2e.b off end # Floppy Controller
+ device pnp 2e.11 off end # Parallel Port
+ end
+ end
+
+ device ref hda on end
+
+ device ref smbus on end
+ end
+end
diff --git a/src/mainboard/dell/optiplex_3050/dsdt.asl b/src/mainboard/dell/optiplex_3050/dsdt.asl
new file mode 100644
index 0000000000..9762f6ff74
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/dsdt.asl
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi.h>
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ ACPI_DSDT_REV_2,
+ OEM_ID,
+ ACPI_TABLE_CREATOR,
+ 0x20110725
+)
+{
+ #include <acpi/dsdt_top.asl>
+ #include <soc/intel/common/block/acpi/acpi/globalnvs.asl>
+ #include <cpu/intel/common/acpi/cpu.asl>
+
+ Scope (\_SB)
+ {
+ Device (PCI0)
+ {
+ #include <soc/intel/skylake/acpi/systemagent.asl>
+ #include <soc/intel/skylake/acpi/pch.asl>
+ }
+ }
+
+ #include <southbridge/intel/common/acpi/sleepstates.asl>
+}
diff --git a/src/mainboard/dell/optiplex_3050/gma-mainboard.ads b/src/mainboard/dell/optiplex_3050/gma-mainboard.ads
new file mode 100644
index 0000000000..cb4c22f285
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/gma-mainboard.ads
@@ -0,0 +1,19 @@
+-- SPDX-License-Identifier: GPL-2.0-or-later
+
+with HW.GFX.GMA;
+with HW.GFX.GMA.Display_Probing;
+
+use HW.GFX.GMA;
+use HW.GFX.GMA.Display_Probing;
+
+private package GMA.Mainboard is
+
+ ports : constant Port_List :=
+ (HDMI1, -- External HDMI
+ DP2, -- External DP (native)
+ HDMI2, -- External DP (DP++)
+ DP3, -- Video I/O card: VGA (0PKGGG), DP (H64DC)
+ HDMI3, -- Video I/O card: VGA (0PKGGG), DP (H64DC)
+ others => Disabled);
+
+end GMA.Mainboard;
diff --git a/src/mainboard/dell/optiplex_3050/hda_verb.c b/src/mainboard/dell/optiplex_3050/hda_verb.c
new file mode 100644
index 0000000000..621e4f7a52
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/hda_verb.c
@@ -0,0 +1,90 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
+ /* coreboot specific header, codec 0 */
+ 0x10ec0255, /* Realtek ALC3234 */
+ 0x102807a3, /* Subsystem ID */
+ 11, /* Number of entries */
+
+ /* Pin Widget Verb Table */
+
+ AZALIA_SUBVENDOR(0, 0x102807a3),
+
+ AZALIA_PIN_CFG(0, 0x12, 0x40000000), // does not describe a jack or internal device
+ AZALIA_PIN_CFG(0, 0x14, AZALIA_PIN_DESC(
+ AZALIA_INTEGRATED,
+ AZALIA_INTERNAL,
+ AZALIA_SPEAKER,
+ AZALIA_OTHER_ANALOG,
+ AZALIA_COLOR_UNKNOWN,
+ AZALIA_NO_JACK_PRESENCE_DETECT,
+ 5, 0
+ )),
+ AZALIA_PIN_CFG(0, 0x17, AZALIA_PIN_CFG_NC(0)),
+ AZALIA_PIN_CFG(0, 0x18, AZALIA_PIN_CFG_NC(0)),
+ AZALIA_PIN_CFG(0, 0x19, AZALIA_PIN_CFG_NC(0)),
+ AZALIA_PIN_CFG(0, 0x1a, AZALIA_PIN_CFG_NC(0)),
+ AZALIA_PIN_CFG(0, 0x1b, AZALIA_PIN_DESC(
+ AZALIA_JACK,
+ AZALIA_EXTERNAL_PRIMARY_CHASSIS | AZALIA_FRONT,
+ AZALIA_LINE_OUT,
+ AZALIA_STEREO_MONO_1_8,
+ AZALIA_BLACK,
+ AZALIA_JACK_PRESENCE_DETECT,
+ 2, 0
+ )),
+ AZALIA_PIN_CFG(0, 0x1d, 0x4054c029), // does not describe a jack or internal device
+ AZALIA_PIN_CFG(0, 0x1e, AZALIA_PIN_CFG_NC(0)),
+ AZALIA_PIN_CFG(0, 0x21, AZALIA_PIN_DESC(
+ AZALIA_JACK,
+ AZALIA_EXTERNAL_PRIMARY_CHASSIS | AZALIA_FRONT,
+ AZALIA_HP_OUT,
+ AZALIA_STEREO_MONO_1_8,
+ AZALIA_BLACK,
+ AZALIA_JACK_PRESENCE_DETECT,
+ 5, 15
+ )),
+
+ /* coreboot specific header, codec 2 */
+ 0x80862809, /* Intel Skylake HDMI */
+ 0x80860101, /* Subsystem ID */
+ 4, /* Number of entries */
+
+ /* Pin Widget Verb Table */
+
+ AZALIA_SUBVENDOR(2, 0x80860101),
+
+ AZALIA_PIN_CFG(2, 0x05, AZALIA_PIN_DESC(
+ AZALIA_JACK,
+ AZALIA_DIGITAL_DISPLAY,
+ AZALIA_DIGITAL_OTHER_OUT,
+ AZALIA_OTHER_DIGITAL,
+ AZALIA_COLOR_UNKNOWN,
+ AZALIA_JACK_PRESENCE_DETECT,
+ 1, 0
+ )),
+ AZALIA_PIN_CFG(2, 0x06, AZALIA_PIN_DESC(
+ AZALIA_JACK,
+ AZALIA_DIGITAL_DISPLAY,
+ AZALIA_DIGITAL_OTHER_OUT,
+ AZALIA_OTHER_DIGITAL,
+ AZALIA_COLOR_UNKNOWN,
+ AZALIA_JACK_PRESENCE_DETECT,
+ 1, 0
+ )),
+ AZALIA_PIN_CFG(2, 0x07, AZALIA_PIN_DESC(
+ AZALIA_JACK,
+ AZALIA_DIGITAL_DISPLAY,
+ AZALIA_DIGITAL_OTHER_OUT,
+ AZALIA_OTHER_DIGITAL,
+ AZALIA_COLOR_UNKNOWN,
+ AZALIA_JACK_PRESENCE_DETECT,
+ 1, 0
+ )),
+};
+
+const u32 pc_beep_verbs[] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/dell/optiplex_3050/include/early_gpio.h b/src/mainboard/dell/optiplex_3050/include/early_gpio.h
new file mode 100644
index 0000000000..17a16371e3
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/include/early_gpio.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __OPTIPLEX_3050_EARLY_GPIO_H__
+#define __OPTIPLEX_3050_EARLY_GPIO_H__
+
+static const struct pad_config early_gpio_table[] = {
+ PAD_CFG_NF(GPP_C8, NONE, DEEP, NF1), /* UART0_RXD */
+ PAD_CFG_NF(GPP_C9, NONE, DEEP, NF1), /* UART0_TXD */
+};
+
+#endif
diff --git a/src/mainboard/dell/optiplex_3050/include/gpio.h b/src/mainboard/dell/optiplex_3050/include/gpio.h
new file mode 100644
index 0000000000..83293c32a9
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/include/gpio.h
@@ -0,0 +1,241 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __OPTIPLEX_3050_GPIO_H__
+#define __OPTIPLEX_3050_GPIO_H__
+
+static const struct pad_config gpio_table[] = {
+
+ /* ------- GPIO Community 0 ------- */
+
+ /* ------- GPIO Group GPP_A ------- */
+ PAD_CFG_NF(GPP_A0, UP_20K, PLTRST, NF1), /* RCIN# */
+ PAD_CFG_NF(GPP_A1, UP_20K, PLTRST, NF1), /* LAD0 */
+ PAD_CFG_NF(GPP_A2, UP_20K, PLTRST, NF1), /* LAD1 */
+ PAD_CFG_NF(GPP_A3, UP_20K, PLTRST, NF1), /* LAD2 */
+ PAD_CFG_NF(GPP_A4, UP_20K, PLTRST, NF1), /* LAD3 */
+ PAD_CFG_NF(GPP_A5, NONE, PLTRST, NF1), /* LFRAME# */
+ PAD_CFG_NF(GPP_A6, NONE, PLTRST, NF1), /* SERIRQ */
+ PAD_CFG_GPI_TRIG_OWN(GPP_A7, NONE, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_NF(GPP_A8, NONE, DEEP, NF1), /* CLKRUN# */
+ PAD_CFG_NF(GPP_A9, NONE, PLTRST, NF1), /* CLKOUT_LPC0 */
+ PAD_CFG_NF(GPP_A10, NONE, PLTRST, NF1), /* CLKOUT_LPC1 */
+ PAD_CFG_NF(GPP_A11, UP_20K, DEEP, NF1), /* PME# */
+ PAD_CFG_GPO(GPP_A12, 0, PLTRST), /* GPIO */
+ PAD_CFG_NF(GPP_A13, NONE, PLTRST, NF1), /* SUSWARN#/SUSPWRDNACK */
+ PAD_CFG_GPI_TRIG_OWN(GPP_A14, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_NF(GPP_A15, UP_20K, PLTRST, NF1), /* SUS_ACK# */
+ PAD_CFG_GPO(GPP_A16, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_A17, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_A18, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_A19, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_A20, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_A21, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_A22, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_A23, 0, PLTRST), /* GPIO */
+
+ /* ------- GPIO Group GPP_B ------- */
+ PAD_CFG_GPO(GPP_B0, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_B1, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_B2, 0, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_B3, 1, RSMRST), /* GPIO (ME_CNTL, B3 -> LOW => HDA_SDO -> HIGH) */
+ PAD_CFG_GPI_TRIG_OWN(GPP_B4, NONE, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPO(GPP_B5, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_B6, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_B7, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_B8, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPO(GPP_B9, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_B10, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_B11, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_NF(GPP_B12, NONE, PLTRST, NF1), /* SLP_S0# */
+ PAD_CFG_NF(GPP_B13, NONE, PLTRST, NF1), /* PLTRST# */
+ PAD_CFG_NF(GPP_B14, DN_20K, PLTRST, NF1), /* SPKR */
+ PAD_CFG_GPO(GPP_B15, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_B16, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_B17, 0, PLTRST), /* GPIO */
+ PAD_CFG_NF(GPP_B18, DN_20K, DEEP, NF1), /* GSPIO_MOSI */
+ PAD_CFG_GPO(GPP_B19, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_B20, 1, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_B21, 0, DEEP), /* GPIO */
+ PAD_CFG_NF(GPP_B22, DN_20K, DEEP, NF1), /* GSPI1_MOSI */
+ PAD_CFG_NF(GPP_B23, DN_20K, DEEP, NF2), /* PCHHOT# */
+
+ /* ------- GPIO Community 1 ------- */
+
+ /* ------- GPIO Group GPP_C ------- */
+ PAD_CFG_NF(GPP_C0, NONE, DEEP, NF1), /* SMBCLK */
+ PAD_CFG_NF(GPP_C1, NONE, DEEP, NF1), /* SMBDATA */
+ PAD_CFG_GPI_TRIG_OWN(GPP_C2, DN_20K, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_NF(GPP_C3, NONE, PLTRST, NF1), /* SML0CLK */
+ PAD_CFG_NF(GPP_C4, NONE, PLTRST, NF1), /* SML0DATA */
+ PAD_CFG_GPI_TRIG_OWN(GPP_C5, DN_20K, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_NF(GPP_C6, NONE, DEEP, NF1), /* SML1CLK */
+ PAD_CFG_NF(GPP_C7, NONE, DEEP, NF1), /* SML1DATA */
+ PAD_CFG_NF(GPP_C8, NONE, DEEP, NF1), /* UART0_RXD */
+ PAD_CFG_NF(GPP_C9, NONE, DEEP, NF1), /* UART0_TXD */
+ PAD_CFG_GPO(GPP_C10, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_C11, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_C12, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_C13, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_C14, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_C15, 0, PLTRST), /* GPIO */
+ PAD_CFG_NF(GPP_C16, NONE, PLTRST, NF1), /* I2C0_SDA */
+ PAD_CFG_NF(GPP_C17, NONE, PLTRST, NF1), /* I2C0_SCL */
+ PAD_CFG_GPO(GPP_C18, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_C19, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_C20, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_C21, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_C22, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPI_SCI(GPP_C23, NONE, DEEP, EDGE_SINGLE, INVERT), /* GPIO */
+
+ /* ------- GPIO Group GPP_D ------- */
+ PAD_CFG_GPO(GPP_D0, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D1, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D2, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D3, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D4, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_D5, NONE, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPO(GPP_D6, 0, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_D7, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D8, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D9, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D10, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D11, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D12, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D13, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D14, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D15, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D16, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D17, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D18, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D19, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D20, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D21, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D22, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_D23, 0, PLTRST), /* GPIO */
+
+ /* ------- GPIO Group GPP_E ------- */
+ PAD_CFG_NF(GPP_E0, NONE, DEEP, NF1), /* SATAXPCIE0 */
+ PAD_CFG_NF(GPP_E1, NONE, DEEP, NF1), /* SATAXPCIE1 */
+ PAD_CFG_NF(GPP_E2, NONE, DEEP, NF1), /* SATAXPCIE2 */
+ PAD_CFG_GPO(GPP_E3, 0, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_E4, 0, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_E5, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_E6, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_E7, NONE, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_NF(GPP_E8, NONE, PLTRST, NF1), /* SATA_LED# */
+ PAD_CFG_NF(GPP_E9, UP_20K, PLTRST, NF1), /* USB_OC0# */
+ PAD_CFG_NF(GPP_E10, UP_20K, PLTRST, NF1), /* USB_OC1# */
+ PAD_CFG_NF(GPP_E11, UP_20K, PLTRST, NF1), /* USB_OC2# */
+ PAD_CFG_NF(GPP_E12, UP_20K, PLTRST, NF1), /* USB_OC3# */
+
+ /* ------- GPIO Group GPP_F ------- */
+ PAD_CFG_NF(GPP_F0, NONE, DEEP, NF1), /* SATAXPCIE3 */
+ PAD_CFG_NF(GPP_F1, NONE, DEEP, NF1), /* SATAXPCIE4 */
+ PAD_CFG_NF(GPP_F2, NONE, DEEP, NF1), /* SATAXPCIE5 */
+ PAD_CFG_NF(GPP_F3, NONE, DEEP, NF1), /* SATAXPCIE6 */
+ PAD_CFG_NF(GPP_F4, NONE, DEEP, NF1), /* SATAXPCIE7 */
+ PAD_CFG_GPI_TRIG_OWN(GPP_F5, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_NF(GPP_F6, NONE, RSMRST, NF1), /* SATA_DEVSLP4 */
+ PAD_CFG_GPO(GPP_F7, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_F8, NONE, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPO(GPP_F9, 0, RSMRST), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_F10, NONE, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_F11, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_F12, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPO(GPP_F13, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_F14, NONE, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_NF(GPP_F15, UP_20K, DEEP, NF1), /* USB_OC4# */
+ PAD_CFG_NF(GPP_F16, UP_20K, DEEP, NF1), /* USB_OC5# */
+ PAD_CFG_NF(GPP_F17, UP_20K, PLTRST, NF1), /* USB_OC6# */
+ PAD_CFG_TERM_GPO(GPP_F18, 0, UP_20K, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_F19, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_F20, 1, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_F21, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_F22, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_F23, 1, RSMRST), /* GPIO */
+
+ /* ------- GPIO Group GPP_G ------- */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G0, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G1, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G2, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G3, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G4, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G5, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G6, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G7, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G8, NONE, PLTRST, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPO(GPP_G9, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G10, NONE, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G11, NONE, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPO(GPP_G12, 1, DEEP), /* GPIO */
+ PAD_CFG_GPI_TRIG_OWN(GPP_G13, NONE, DEEP, OFF, ACPI), /* GPIO */
+ PAD_CFG_GPO(GPP_G14, 0, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_G15, 1, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_G16, 1, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_G17, 1, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_G18, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_G19, 1, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_G20, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_G21, 0, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_G22, 0, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_G23, 0, PLTRST), /* GPIO */
+
+ /* ------- GPIO Group GPP_H ------- */
+ PAD_CFG_GPO(GPP_H0, 0, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_H1, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H2, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H3, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H4, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H5, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H6, 1, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_H7, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H8, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H9, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H10, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H11, 0, PLTRST), /* GPIO */
+ PAD_CFG_TERM_GPO(GPP_H12, 1, DN_20K, DEEP), /* GPIO */
+ PAD_CFG_GPO(GPP_H13, 1, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H14, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H15, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H16, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H17, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H18, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H19, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H20, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H21, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H22, 0, PLTRST), /* GPIO */
+ PAD_CFG_GPO(GPP_H23, 0, PLTRST), /* GPIO */
+
+ /* ------- GPIO Community 2 ------- */
+
+ /* -------- GPIO Group GPD -------- */
+ PAD_CFG_NF(GPD0, NONE, RSMRST, NF1), /* BATLOW# */
+ PAD_CFG_GPO(GPD1, 0, PWROK), /* GPIO */
+ PAD_CFG_NF(GPD2, NONE, RSMRST, NF1), /* LAN_WAKE# */
+ PAD_CFG_NF(GPD3, UP_20K, RSMRST, NF1), /* PWRBTN# */
+ PAD_CFG_NF(GPD4, NONE, RSMRST, NF1), /* SLP_S3# */
+ PAD_CFG_NF(GPD5, NONE, RSMRST, NF1), /* SLP_S4# */
+ PAD_CFG_NF(GPD6, NONE, RSMRST, NF1), /* SLP_A# */
+ PAD_CFG_GPO(GPD7, 1, RSMRST), /* GPIO */
+ PAD_CFG_NF(GPD8, NONE, RSMRST, NF1), /* SUSCLK */
+ PAD_CFG_NF(GPD9, NONE, RSMRST, NF1), /* SLP_WLAN# */
+ PAD_CFG_NF(GPD10, NONE, RSMRST, NF1), /* SLP_S5# */
+ PAD_CFG_GPO(GPD11, 1, RSMRST), /* GPIO */
+
+ /* ------- GPIO Community 3 ------- */
+
+ /* ------- GPIO Group GPP_I ------- */
+ PAD_CFG_NF(GPP_I0, NONE, PLTRST, NF1), /* DDPB_HPD0 */
+ PAD_CFG_NF(GPP_I1, NONE, PLTRST, NF1), /* DDPC_HPD1 */
+ PAD_CFG_NF(GPP_I2, NONE, PLTRST, NF1), /* DDPD_HPD2 */
+ PAD_CFG_NF(GPP_I3, NONE, PLTRST, NF1), /* DDPE_HPD3 */
+ PAD_CFG_NF(GPP_I4, NONE, PLTRST, NF1), /* EDP_HPD */
+ PAD_CFG_NF(GPP_I5, NONE, PLTRST, NF1), /* DDPB_CTRLCLK */
+ PAD_CFG_NF(GPP_I6, DN_20K, PLTRST, NF1), /* DDPB_CTRLDATA */
+ PAD_CFG_NF(GPP_I7, NONE, PLTRST, NF1), /* DDPC_CTRLCLK */
+ PAD_CFG_NF(GPP_I8, DN_20K, PLTRST, NF1), /* DDPC_CTRLDATA */
+ PAD_CFG_NF(GPP_I9, NONE, PLTRST, NF1), /* DDPD_CTRLCLK */
+ PAD_CFG_NF(GPP_I10, DN_20K, PLTRST, NF1), /* DDPD_CTRLDATA */
+};
+
+#endif
diff --git a/src/mainboard/dell/optiplex_3050/ramstage.c b/src/mainboard/dell/optiplex_3050/ramstage.c
new file mode 100644
index 0000000000..94778f60c9
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/ramstage.c
@@ -0,0 +1,512 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <bootstate.h>
+#include <arch/cpuid.h>
+#include <cpu/x86/msr.h>
+#include <soc/gpio.h>
+#include <soc/ramstage.h>
+#include "include/gpio.h"
+#include "sch5555_ec.h"
+
+void mainboard_silicon_init_params(FSP_SIL_UPD *params)
+{
+ gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
+}
+
+#define FORM_FACTOR_MICRO 0
+#define FORM_FACTOR_SFF 1
+// Probably DT and MT
+#define FORM_FACTOR_UNK2 2
+#define FORM_FACTOR_UNK3 3
+
+#define HWM_TAB_ADD_TEMP_TARGET 1
+#define HWM_TAB_PKG_POWER_ANY 0xffff
+
+struct hwm_tab_entry {
+ uint16_t addr;
+ uint8_t val;
+ uint8_t flags;
+ uint16_t pkg_power;
+};
+
+static const struct hwm_tab_entry HWM_TAB_MICRO_BASE[] = {
+ { 0x005, 0x33, 0, 0xffff },
+ { 0x018, 0x2f, 0, 0xffff },
+ { 0x019, 0x2f, 0, 0xffff },
+ { 0x01a, 0x2f, 0, 0xffff },
+ { 0x01b, 0x0f, 0, 0xffff },
+ { 0x057, 0xff, 0, 0xffff },
+ { 0x059, 0xff, 0, 0xffff },
+ { 0x05b, 0xff, 0, 0xffff },
+ { 0x05d, 0xff, 0, 0xffff },
+ { 0x05f, 0xff, 0, 0xffff },
+ { 0x061, 0xff, 0, 0xffff },
+ { 0x06e, 0x00, 0, 0xffff },
+ { 0x06f, 0x03, 0, 0xffff },
+ { 0x070, 0x03, 0, 0xffff },
+ { 0x071, 0x02, 0, 0xffff },
+ { 0x072, 0x02, 0, 0xffff },
+ { 0x073, 0x01, 0, 0xffff },
+ { 0x074, 0x06, 0, 0xffff },
+ { 0x075, 0x07, 0, 0xffff },
+ { 0x080, 0x00, 0, 0xffff },
+ { 0x081, 0x80, 0, 0xffff },
+ { 0x082, 0x80, 0, 0xffff },
+ { 0x083, 0xbb, 0, 0xffff },
+ { 0x085, 0xf1, 0, 0xffff },
+ { 0x086, 0x88, 0, 0xffff },
+ { 0x087, 0x61, 0, 0xffff },
+ { 0x088, 0x08, 0, 0xffff },
+ { 0x089, 0x00, 0, 0xffff },
+ { 0x08a, 0x73, 0, 0xffff },
+ { 0x08b, 0x73, 0, 0xffff },
+ { 0x08c, 0x73, 0, 0xffff },
+ { 0x090, 0x6d, 0, 0xffff },
+ { 0x091, 0x7e, 0, 0xffff },
+ { 0x092, 0x66, 0, 0xffff },
+ { 0x093, 0xa4, 0, 0xffff },
+ { 0x094, 0x7c, 0, 0xffff },
+ { 0x095, 0xa4, 0, 0xffff },
+ { 0x096, 0xa4, 0, 0xffff },
+ { 0x097, 0xa4, 0, 0xffff },
+ { 0x098, 0xa4, 0, 0xffff },
+ { 0x099, 0xa4, 0, 0xffff },
+ { 0x09a, 0xa4, 0, 0xffff },
+ { 0x09b, 0xa4, 0, 0xffff },
+ { 0x0a0, 0x2e, 0, 0xffff },
+ { 0x0a1, 0x00, 0, 0xffff },
+ { 0x0a2, 0x00, 0, 0xffff },
+ { 0x0ae, 0xa4, 0, 0xffff },
+ { 0x0af, 0xa4, 0, 0xffff },
+ { 0x0b0, 0xa4, 0, 0xffff },
+ { 0x0b1, 0xa4, 0, 0xffff },
+ { 0x0b2, 0xa4, 0, 0xffff },
+ { 0x0b3, 0xa4, 0, 0xffff },
+ { 0x0b6, 0x00, 0, 0xffff },
+ { 0x0b7, 0x00, 0, 0xffff },
+ { 0x0d1, 0xff, 0, 0xffff },
+ { 0x0d6, 0xff, 0, 0xffff },
+ { 0x0db, 0xff, 0, 0xffff },
+ { 0x0ea, 0x5c, 0, 0xffff },
+ { 0x0eb, 0x5c, 0, 0xffff },
+ { 0x0ef, 0xff, 0, 0xffff },
+ { 0x0f8, 0x15, 0, 0xffff },
+ { 0x0f9, 0x00, 0, 0xffff },
+ { 0x0f0, 0x30, 0, 0xffff },
+ { 0x184, 0xff, 0, 0xffff },
+ { 0x186, 0xff, 0, 0xffff },
+ { 0x1a1, 0xce, 0, 0xffff },
+ { 0x1a2, 0x0c, 0, 0xffff },
+ { 0x1a3, 0x0c, 0, 0xffff },
+ { 0x1a6, 0x00, 0, 0xffff },
+ { 0x1a7, 0x00, 0, 0xffff },
+ { 0x1a8, 0xa4, 0, 0xffff },
+ { 0x1a9, 0xa4, 0, 0xffff },
+ { 0x1ab, 0x2d, 0, 0xffff },
+ { 0x1ac, 0x2d, 0, 0xffff },
+ { 0x1b1, 0x00, 0, 0xffff },
+ { 0x1bb, 0x00, 0, 0xffff },
+ { 0x1bc, 0x00, 0, 0xffff },
+ { 0x1bd, 0x00, 0, 0xffff },
+ { 0x1be, 0x01, 0, 0xffff },
+ { 0x1bf, 0x01, 0, 0xffff },
+ { 0x1c0, 0x01, 0, 0xffff },
+ { 0x1c1, 0x01, 0, 0xffff },
+ { 0x1c2, 0x01, 0, 0xffff },
+ { 0x280, 0x00, 0, 0xffff },
+ { 0x281, 0x00, 0, 0xffff },
+ { 0x282, 0x03, 0, 0xffff },
+ { 0x283, 0x0a, 0, 0xffff },
+ { 0x284, 0x80, 0, 0xffff },
+ { 0x285, 0x03, 0, 0xffff },
+ { 0x040, 0x01, 0, 0xffff },
+};
+
+static const struct hwm_tab_entry HWM_TAB_MICRO_TEMP80[] = {
+ { 0x005, 0x33, 0, 0xffff },
+ { 0x018, 0x2f, 0, 0xffff },
+ { 0x019, 0x2f, 0, 0xffff },
+ { 0x01a, 0x2f, 0, 0xffff },
+ { 0x01b, 0x0f, 0, 0xffff },
+ { 0x057, 0xff, 0, 0xffff },
+ { 0x059, 0xff, 0, 0xffff },
+ { 0x05b, 0xff, 0, 0xffff },
+ { 0x05d, 0xff, 0, 0xffff },
+ { 0x05f, 0xff, 0, 0xffff },
+ { 0x061, 0xff, 0, 0xffff },
+ { 0x06e, 0x00, 0, 0xffff },
+ { 0x06f, 0x03, 0, 0xffff },
+ { 0x070, 0x03, 0, 0xffff },
+ { 0x071, 0x02, 0, 0xffff },
+ { 0x072, 0x02, 0, 0xffff },
+ { 0x073, 0x01, 0, 0xffff },
+ { 0x074, 0x06, 0, 0xffff },
+ { 0x075, 0x07, 0, 0xffff },
+ { 0x080, 0x00, 0, 0xffff },
+ { 0x081, 0x80, 0, 0xffff },
+ { 0x082, 0x80, 0, 0xffff },
+ { 0x083, 0xbb, 0, 0xffff },
+ { 0x085, 0xf6, 0, 0xffff },
+ { 0x086, 0x88, 0, 0xffff },
+ { 0x087, 0x61, 0, 0xffff },
+ { 0x088, 0x08, 0, 0xffff },
+ { 0x089, 0x00, 0, 0xffff },
+ { 0x08a, 0x73, 0, 0xffff },
+ { 0x08b, 0x73, 0, 0xffff },
+ { 0x08c, 0x73, 0, 0xffff },
+ { 0x090, 0x6d, 0, 0xffff },
+ { 0x091, 0x86, 0, 0xffff },
+ { 0x092, 0x66, 0, 0xffff },
+ { 0x093, 0xa4, 0, 0xffff },
+ { 0x094, 0x7c, 0, 0xffff },
+ { 0x095, 0xa4, 0, 0xffff },
+ { 0x096, 0xa4, 0, 0xffff },
+ { 0x097, 0xa4, 0, 0xffff },
+ { 0x098, 0xa4, 0, 0xffff },
+ { 0x099, 0xa4, 0, 0xffff },
+ { 0x09a, 0xa4, 0, 0xffff },
+ { 0x09b, 0xa4, 0, 0xffff },
+ { 0x0a0, 0x2e, 0, 0xffff },
+ { 0x0a1, 0x00, 0, 0xffff },
+ { 0x0a2, 0x00, 0, 0xffff },
+ { 0x0ae, 0xa4, 0, 0xffff },
+ { 0x0af, 0xa4, 0, 0xffff },
+ { 0x0b0, 0xa4, 0, 0xffff },
+ { 0x0b1, 0xa4, 0, 0xffff },
+ { 0x0b2, 0xa4, 0, 0xffff },
+ { 0x0b3, 0xa4, 0, 0xffff },
+ { 0x0b6, 0x00, 0, 0xffff },
+ { 0x0b7, 0x00, 0, 0xffff },
+ { 0x0d1, 0xff, 0, 0xffff },
+ { 0x0d6, 0xff, 0, 0xffff },
+ { 0x0db, 0xff, 0, 0xffff },
+ { 0x0ea, 0x50, 0, 0xffff },
+ { 0x0eb, 0x50, 0, 0xffff },
+ { 0x0ef, 0xff, 0, 0xffff },
+ { 0x0f8, 0x15, 0, 0xffff },
+ { 0x0f9, 0x00, 0, 0xffff },
+ { 0x0f0, 0x30, 0, 0xffff },
+ { 0x184, 0xff, 0, 0xffff },
+ { 0x186, 0xff, 0, 0xffff },
+ { 0x1a1, 0xce, 0, 0xffff },
+ { 0x1a2, 0x0c, 0, 0xffff },
+ { 0x1a3, 0x0c, 0, 0xffff },
+ { 0x1a6, 0x00, 0, 0xffff },
+ { 0x1a7, 0x00, 0, 0xffff },
+ { 0x1a8, 0xa4, 0, 0xffff },
+ { 0x1a9, 0xa4, 0, 0xffff },
+ { 0x1ab, 0x2d, 0, 0xffff },
+ { 0x1ac, 0x2d, 0, 0xffff },
+ { 0x1b1, 0x00, 0, 0xffff },
+ { 0x1bb, 0x00, 0, 0xffff },
+ { 0x1bc, 0x00, 0, 0xffff },
+ { 0x1bd, 0x00, 0, 0xffff },
+ { 0x1be, 0x01, 0, 0xffff },
+ { 0x1bf, 0x01, 0, 0xffff },
+ { 0x1c0, 0x01, 0, 0xffff },
+ { 0x1c1, 0x01, 0, 0xffff },
+ { 0x1c2, 0x01, 0, 0xffff },
+ { 0x280, 0x00, 0, 0xffff },
+ { 0x281, 0x00, 0, 0xffff },
+ { 0x282, 0x03, 0, 0xffff },
+ { 0x283, 0x0a, 0, 0xffff },
+ { 0x284, 0x80, 0, 0xffff },
+ { 0x285, 0x03, 0, 0xffff },
+ { 0x040, 0x01, 0, 0xffff },
+};
+
+static const struct hwm_tab_entry HWM_TAB_MICRO_EARLY_STEPPING[] = {
+ { 0x005, 0x33, 0, 0xffff },
+ { 0x018, 0x2f, 0, 0xffff },
+ { 0x019, 0x2f, 0, 0xffff },
+ { 0x01a, 0x2f, 0, 0xffff },
+ { 0x01b, 0x0f, 0, 0xffff },
+ { 0x057, 0xff, 0, 0xffff },
+ { 0x059, 0xff, 0, 0xffff },
+ { 0x05b, 0xff, 0, 0xffff },
+ { 0x05d, 0xff, 0, 0xffff },
+ { 0x05f, 0xff, 0, 0xffff },
+ { 0x061, 0xff, 0, 0xffff },
+ { 0x06e, 0x01, 0, 0xffff },
+ { 0x06f, 0x03, 0, 0xffff },
+ { 0x070, 0x03, 0, 0xffff },
+ { 0x071, 0x02, 0, 0xffff },
+ { 0x072, 0x02, 0, 0xffff },
+ { 0x073, 0x01, 0, 0xffff },
+ { 0x074, 0x06, 0, 0xffff },
+ { 0x075, 0x07, 0, 0xffff },
+ { 0x080, 0x00, 0, 0xffff },
+ { 0x081, 0x80, 0, 0xffff },
+ { 0x082, 0x80, 0, 0xffff },
+ { 0x083, 0xbb, 0, 0xffff },
+ { 0x085, 0xfd, 0, 0xffff },
+ { 0x086, 0x60, 0, 0xffff },
+ { 0x087, 0x50, 0, 0xffff },
+ { 0x088, 0x08, 0, 0xffff },
+ { 0x089, 0x00, 0, 0xffff },
+ { 0x08a, 0x73, 0, 0xffff },
+ { 0x08b, 0x73, 0, 0xffff },
+ { 0x08c, 0x73, 0, 0xffff },
+ { 0x090, 0x6d, 0, 0xffff },
+ { 0x091, 0x7a, 0, 0xffff },
+ { 0x092, 0x6b, 0, 0xffff },
+ { 0x093, 0xa4, 0, 0xffff },
+ { 0x094, 0x78, 0, 0xffff },
+ { 0x095, 0xa4, 0, 0xffff },
+ { 0x096, 0xa4, 0, 0xffff },
+ { 0x097, 0xa4, 0, 0xffff },
+ { 0x098, 0xa4, 0, 0xffff },
+ { 0x099, 0xa4, 0, 0xffff },
+ { 0x09a, 0xa4, 0, 0xffff },
+ { 0x09b, 0xa4, 0, 0xffff },
+ { 0x0a0, 0x2e, 0, 0xffff },
+ { 0x0a1, 0x00, 0, 0xffff },
+ { 0x0a2, 0x00, 0, 0xffff },
+ { 0x0ae, 0xa4, 0, 0xffff },
+ { 0x0af, 0xa4, 0, 0xffff },
+ { 0x0b0, 0xa4, 0, 0xffff },
+ { 0x0b1, 0xa4, 0, 0xffff },
+ { 0x0b2, 0xa4, 0, 0xffff },
+ { 0x0b3, 0xa4, 0, 0xffff },
+ { 0x0b6, 0x00, 0, 0xffff },
+ { 0x0b7, 0x00, 0, 0xffff },
+ { 0x0d1, 0xff, 0, 0xffff },
+ { 0x0d6, 0xff, 0, 0xffff },
+ { 0x0db, 0xff, 0, 0xffff },
+ { 0x0ea, 0x64, 0, 0xffff },
+ { 0x0eb, 0x64, 0, 0xffff },
+ { 0x0ef, 0xff, 0, 0xffff },
+ { 0x0f8, 0x15, 0, 0xffff },
+ { 0x0f9, 0x00, 0, 0xffff },
+ { 0x0f0, 0x30, 0, 0xffff },
+ { 0x184, 0xff, 0, 0xffff },
+ { 0x186, 0xff, 0, 0xffff },
+ { 0x1a1, 0xce, 0, 0xffff },
+ { 0x1a2, 0x0c, 0, 0xffff },
+ { 0x1a3, 0x0c, 0, 0xffff },
+ { 0x1a6, 0x00, 0, 0xffff },
+ { 0x1a7, 0x00, 0, 0xffff },
+ { 0x1a8, 0xa4, 0, 0xffff },
+ { 0x1a9, 0xa4, 0, 0xffff },
+ { 0x1ab, 0x2d, 0, 0xffff },
+ { 0x1ac, 0x2d, 0, 0xffff },
+ { 0x1b1, 0x00, 0, 0xffff },
+ { 0x1bb, 0x00, 0, 0xffff },
+ { 0x1bc, 0x00, 0, 0xffff },
+ { 0x1bd, 0x00, 0, 0xffff },
+ { 0x1be, 0x01, 0, 0xffff },
+ { 0x1bf, 0x01, 0, 0xffff },
+ { 0x1c0, 0x01, 0, 0xffff },
+ { 0x1c1, 0x01, 0, 0xffff },
+ { 0x1c2, 0x01, 0, 0xffff },
+ { 0x280, 0x00, 0, 0xffff },
+ { 0x281, 0x00, 0, 0xffff },
+ { 0x282, 0x03, 0, 0xffff },
+ { 0x283, 0x0a, 0, 0xffff },
+ { 0x284, 0x80, 0, 0xffff },
+ { 0x285, 0x03, 0, 0xffff },
+ { 0x040, 0x01, 0, 0xffff },
+};
+
+static const struct hwm_tab_entry HWM_TAB_SFF[] = {
+ { 0x019, 0x2f, 0, 0xffff },
+ { 0x040, 0x01, 0, 0xffff },
+ { 0x072, 0x03, 0, 0xffff },
+ { 0x075, 0x06, 0, 0xffff },
+ { 0x07c, 0x00, 0, 0xffff },
+ { 0x080, 0x00, 0, 0xffff },
+ { 0x081, 0x00, 0, 0xffff },
+ { 0x083, 0xbb, 0, 0xffff },
+ { 0x085, 0x59, 0, 0xffff },
+ { 0x086, 0x6a, 0, 0xffff },
+ { 0x087, 0xc0, 0, 0xffff },
+ { 0x08a, 0x33, 0, 0xffff },
+ { 0x090, 0x77, 0, 0xffff },
+ { 0x091, 0x66, 0, 0xffff },
+ { 0x092, 0x94, 0, 0xffff },
+ { 0x093, 0x90, 0, 0xffff },
+ { 0x094, 0x68, 0, 0xffff },
+ { 0x096, 0xa4, 0, 0xffff },
+ { 0x097, 0xa4, 0, 0xffff },
+ { 0x098, 0xa4, 0, 0xffff },
+ { 0x099, 0xa4, 0, 0xffff },
+ { 0x09a, 0xa4, 0, 0xffff },
+ { 0x09b, 0xa4, 0, 0xffff },
+ { 0x0a0, 0x3e, 0, 0xffff },
+ { 0x0ae, 0x86, 0, 0xffff },
+ { 0x0af, 0x86, 0, 0xffff },
+ { 0x0b0, 0xa4, 0, 0xffff },
+ { 0x0b1, 0xa4, 0, 0xffff },
+ { 0x0b2, 0x90, 0, 0xffff },
+ { 0x0b6, 0x48, 0, 0xffff },
+ { 0x0b7, 0x48, 0, 0xffff },
+ { 0x0ea, 0x64, 0, 0xffff },
+ { 0x0f0, 0x30, 0, 0xffff },
+ { 0x1b1, 0x48, 0, 0xffff },
+ { 0x1b8, 0x00, 0, 0xffff },
+ { 0x1be, 0x95, 0, 0xffff },
+ { 0x1c1, 0x90, 0, 0xffff },
+ { 0x1c6, 0x00, 0, 0xffff },
+ { 0x1c9, 0x00, 0, 0xffff },
+ { 0x280, 0x68, 0, 0xffff },
+ { 0x281, 0x10, 0, 0xffff },
+ { 0x282, 0x03, 0, 0xffff },
+ { 0x283, 0x0a, 0, 0xffff },
+ { 0x284, 0x80, 0, 0xffff },
+ { 0x285, 0x03, 0, 0xffff}
+};
+
+static const struct hwm_tab_entry HWM_TAB_MT[] = {
+ { 0x005, 0x33, 0, 0xffff },
+ { 0x018, 0x2f, 0, 0xffff },
+ { 0x019, 0x2f, 0, 0xffff },
+ { 0x01a, 0x2f, 0, 0xffff },
+ { 0x080, 0x00, 0, 0xffff },
+ { 0x081, 0x00, 0, 0xffff },
+ { 0x082, 0x80, 0, 0xffff },
+ { 0x083, 0xbb, 0, 0xffff },
+ { 0x085, 0xb9, 0, 0x0010 },
+ { 0x086, 0xac, 0, 0x0010 },
+ { 0x087, 0x87, 0, 0x0010 },
+ { 0x08a, 0x51, 0, 0x0010 },
+ { 0x08b, 0x39, 0, 0x0010 },
+ { 0x090, 0x78, 0, 0xffff },
+ { 0x091, 0x6a, 0, 0xffff },
+ { 0x092, 0x8f, 0, 0xffff },
+ { 0x094, 0x68, 0, 0xffff },
+ { 0x095, 0x5b, 0, 0xffff },
+ { 0x096, 0x92, 0, 0xffff },
+ { 0x097, 0x86, 0, 0xffff },
+ { 0x098, 0xa4, 0, 0xffff },
+ { 0x09a, 0x8b, 0, 0xffff },
+ { 0x0a0, 0x0a, 0, 0xffff },
+ { 0x0a1, 0x26, 0, 0xffff },
+ { 0x0a2, 0xd1, 0, 0xffff },
+ { 0x0ae, 0x7c, 0, 0xffff },
+ { 0x0af, 0x7c, 0, 0xffff },
+ { 0x0b0, 0x9a, 0, 0xffff },
+ { 0x0b3, 0x7c, 0, 0xffff },
+ { 0x0b6, 0x08, 0, 0xffff },
+ { 0x0b7, 0x00, 0, 0xffff },
+ { 0x0ea, 0x64, 0, 0xffff },
+ { 0x0ef, 0xff, 0, 0xffff },
+ { 0x0f8, 0x15, 0, 0xffff },
+ { 0x0f9, 0x00, 0, 0xffff },
+ { 0x0f0, 0x30, 0, 0xffff },
+ { 0x0fd, 0x01, 0, 0xffff },
+ { 0x1a1, 0x99, 0, 0xffff },
+ { 0x1a2, 0x00, 0, 0xffff },
+ { 0x1a4, 0x00, 0, 0xffff },
+ { 0x1b1, 0x00, 0, 0xffff },
+ { 0x1be, 0x90, 0, 0xffff },
+ { 0x280, 0xc4, 0, 0xffff },
+ { 0x281, 0x09, 0, 0xffff },
+ { 0x282, 0x0a, 0, 0xffff },
+ { 0x283, 0x14, 0, 0xffff },
+ { 0x284, 0x01, 0, 0xffff },
+ { 0x285, 0x01, 0, 0xffff },
+ { 0x288, 0x94, 0, 0xffff },
+ { 0x289, 0x11, 0, 0xffff },
+ { 0x28a, 0x0a, 0, 0xffff },
+ { 0x28b, 0x14, 0, 0xffff },
+ { 0x28c, 0x01, 0, 0xffff },
+ { 0x28d, 0x01, 0, 0xffff },
+ { 0x294, 0x24, 0, 0xffff },
+};
+
+static uint8_t get_temp_target(void)
+{
+ uint8_t val = rdmsr(0x1a2).lo >> 8 & 0xff;
+ if (!val)
+ val = 20;
+ return 0x95 - val;
+}
+
+static uint16_t get_pkg_power(void)
+{
+ const unsigned int pkg_power = rdmsr(0x614).lo & 0x7fff;
+ const unsigned int power_unit = 1 << (rdmsr(0x606).lo & 0xf);
+ if (pkg_power / power_unit > 65)
+ return 32;
+ else
+ return 16;
+}
+
+static uint8_t get_core_cnt(void)
+{
+ // Intel describes this CPUID field as:
+ // > Maximum number of addressable IDs for processor cores in the physical package
+ if (cpuid(0).eax >= 4)
+ return cpuid_ext(4, 0).eax >> 26;
+ return 0;
+}
+
+static void apply_hwm_tab(const struct hwm_tab_entry *arr, size_t size)
+{
+ uint8_t temp_target = get_temp_target();
+ uint16_t pkg_power = get_pkg_power();
+
+ printk(BIOS_DEBUG, "Temp target = %#x\n", temp_target);
+ printk(BIOS_DEBUG, "Package power = %#x\n", pkg_power);
+
+ for (size_t i = 0; i < size; ++i) {
+ // Skip entry if it doesn't apply for this package power
+ if (arr[i].pkg_power != pkg_power &&
+ arr[i].pkg_power != HWM_TAB_PKG_POWER_ANY)
+ continue;
+
+ uint8_t val = arr[i].val;
+
+ // Add temp target to value if requested (current tables never do)
+ if (arr[i].flags & HWM_TAB_ADD_TEMP_TARGET)
+ val += temp_target;
+
+ // Perform write
+ sch5555_mbox_write(1, arr[i].addr, val);
+ }
+}
+
+static void sch5555_ec_hwm_init(void *arg)
+{
+ uint8_t form_fac_id, saved_2fc, core_cnt;
+
+ printk(BIOS_DEBUG, "OptiPlex 3050 late HWM init\n");
+
+ form_fac_id = gpio_get(GPP_G2) | gpio_get(GPP_G3) << 1;
+ printk(BIOS_DEBUG, "Form Factor ID = %#x\n", form_fac_id);
+
+ saved_2fc = sch5555_mbox_read(1, 0x2fc);
+ sch5555_mbox_write(1, 0x2fc, 0xa0);
+ sch5555_mbox_write(1, 0x2fd, 0x32);
+
+ switch (form_fac_id) {
+ case FORM_FACTOR_MICRO:
+ // CPU stepping <= 3
+ if ((cpuid(1).eax & 0xf) <= 3)
+ apply_hwm_tab(HWM_TAB_MICRO_EARLY_STEPPING, ARRAY_SIZE(HWM_TAB_MICRO_EARLY_STEPPING));
+ // Tjunction == 80
+ else if ((rdmsr(0x1a2).lo >> 16 & 0xff) == 80)
+ apply_hwm_tab(HWM_TAB_MICRO_TEMP80, ARRAY_SIZE(HWM_TAB_MICRO_TEMP80));
+ else
+ apply_hwm_tab(HWM_TAB_MICRO_BASE, ARRAY_SIZE(HWM_TAB_MICRO_BASE));
+ break;
+ case FORM_FACTOR_SFF:
+ apply_hwm_tab(HWM_TAB_SFF, ARRAY_SIZE(HWM_TAB_SFF));
+ break;
+ default:
+ apply_hwm_tab(HWM_TAB_MT, ARRAY_SIZE(HWM_TAB_MT));
+ break;
+ }
+
+ core_cnt = get_core_cnt();
+ printk(BIOS_DEBUG, "CPU Core Count = %#x\n", core_cnt);
+ if (core_cnt > 2) {
+ sch5555_mbox_write(1, 0x9e, 0x30);
+ sch5555_mbox_write(1, 0xeb, sch5555_mbox_read(1, 0xea));
+ }
+
+ sch5555_mbox_write(1, 0x2fc, saved_2fc);
+ sch5555_mbox_read(1, 0xb8);
+}
+
+BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_EXIT, sch5555_ec_hwm_init, NULL);
diff --git a/src/mainboard/dell/optiplex_3050/romstage.c b/src/mainboard/dell/optiplex_3050/romstage.c
new file mode 100644
index 0000000000..501b254232
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/romstage.c
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <soc/romstage.h>
+#include <spd_bin.h>
+
+void mainboard_memory_init_params(FSPM_UPD *mupd)
+{
+ struct spd_block blk = { .addr_map = { 0x50, 0x52, } };
+ get_spd_smbus(&blk);
+ dump_spd_info(&blk);
+
+ FSP_M_CONFIG *mem_cfg = &mupd->FspmConfig;
+ mem_cfg->DqPinsInterleaved = true;
+ mem_cfg->CaVrefConfig = 2;
+ mem_cfg->MemorySpdDataLen = blk.len;
+ mem_cfg->MemorySpdPtr00 = (uintptr_t)blk.spd_array[0];
+ mem_cfg->MemorySpdPtr10 = (uintptr_t)blk.spd_array[1];
+}
diff --git a/src/mainboard/dell/optiplex_3050/sch5555_ec.c b/src/mainboard/dell/optiplex_3050/sch5555_ec.c
new file mode 100644
index 0000000000..1df5026531
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/sch5555_ec.c
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <arch/io.h>
+#include <device/pnp_ops.h>
+#include <superio/smsc/sch555x/sch555x.h>
+#include "sch5555_ec.h"
+
+uint8_t sch5555_mbox_read(uint8_t addr1, uint16_t addr2)
+{
+ // clear ec-to-host mailbox
+ uint8_t tmp = inb(SCH555x_EMI_IOBASE + 1);
+ outb(tmp, SCH555x_EMI_IOBASE + 1);
+
+ // send address
+ outw(0 | 0x8001, SCH555x_EMI_IOBASE + 2);
+ outw((addr1 * 2) | 0x100, SCH555x_EMI_IOBASE + 4);
+
+ outw(4 | 0x8002, SCH555x_EMI_IOBASE + 2);
+ outl(addr2 << 16, SCH555x_EMI_IOBASE + 4);
+
+ // send message to ec
+ outb(1, SCH555x_EMI_IOBASE);
+
+ // wait for ack
+ for (size_t retry = 0; retry < 0xfff; ++retry)
+ if (inb(SCH555x_EMI_IOBASE + 1) & 1)
+ break;
+
+ // read result
+ outw(4 | 0x8000, SCH555x_EMI_IOBASE + 2);
+ return inb(SCH555x_EMI_IOBASE + 4);
+}
+
+void sch5555_mbox_write(uint8_t addr1, uint16_t addr2, uint8_t val)
+{
+ // clear ec-to-host mailbox
+ uint8_t tmp = inb(SCH555x_EMI_IOBASE + 1);
+ outb(tmp, SCH555x_EMI_IOBASE + 1);
+
+ // send address and value
+ outw(0 | 0x8001, SCH555x_EMI_IOBASE + 2);
+ outw((addr1 * 2) | 0x101, SCH555x_EMI_IOBASE + 4);
+
+ outw(4 | 0x8002, SCH555x_EMI_IOBASE + 2);
+ outl(val | (addr2 << 16), SCH555x_EMI_IOBASE + 4);
+
+ // send message to ec
+ outb(1, SCH555x_EMI_IOBASE);
+
+ // wait for ack
+ for (size_t retry = 0; retry < 0xfff; ++retry)
+ if (inb(SCH555x_EMI_IOBASE + 1) & 1)
+ break;
+}
diff --git a/src/mainboard/dell/optiplex_3050/sch5555_ec.h b/src/mainboard/dell/optiplex_3050/sch5555_ec.h
new file mode 100644
index 0000000000..9d262d5787
--- /dev/null
+++ b/src/mainboard/dell/optiplex_3050/sch5555_ec.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __SCH5555_EC_H__
+#define __SCH5555_EC_H__
+
+uint8_t sch5555_mbox_read(uint8_t addr1, uint16_t addr2);
+
+void sch5555_mbox_write(uint8_t addr1, uint16_t addr2, uint8_t val);
+
+#endif
--
2.39.5
|