summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.H
blob: aba8a8cd86c82f11323f89ac8de9b9a0a253652e (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
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
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.H $ */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2016,2019                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
// *HWP HWP Owner: Jacob Harvey <jlharvey@us.ibm.com>
// *HWP HWP Backup: Aandre Marin <aamarin@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 3
// *HWP Consumed by: FSP:HB

#ifndef _MSS_EFF_DIMM_H_
#define _MSS_EFF_DIMM_H_

#include <fapi2.H>
#include <lib/shared/mss_kind.H>
#include <lib/shared/mss_const.H>
#include <generic/memory/lib/spd/spd_facade.H>
#include <generic/memory/lib/spd/common/rcw_settings.H>
#include <lib/spd/spd_factory.H>
#include <lib/eff_config/timing.H>
#include <generic/memory/lib/data_engine/pre_data_init.H>
#include <generic/memory/lib/spd/spd_utils.H>

namespace mss
{

///
/// @brief Gets the JEDEC train and range values from the encoded VPD value
/// @param[in] i_target - the DIMM target on which to operate
/// @param[out] o_range - the JEDEC VREFDQ range
/// @param[out] o_value - the JEDEC VREFDQ value
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
///
fapi2::ReturnCode get_vpd_wr_vref_range_and_value( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
        uint8_t& o_range,
        uint8_t& o_value );

///
/// @class mss::dimm::eff_dimm
/// @brief A class made to perform eff_config functions based on the different dimm kinds (gen, type, buffer type)
/// @note this is a base class
///
class eff_dimm
{
    protected:
        fapi2::Target<fapi2::TARGET_TYPE_DIMM> iv_dimm;
        fapi2::Target<fapi2::TARGET_TYPE_MCA> iv_mca;
        fapi2::Target<fapi2::TARGET_TYPE_MCS> iv_mcs;
        size_t iv_port_index;
        size_t iv_dimm_index;
        int64_t iv_ftb; // fine timebase
        int64_t iv_mtb; // medium timebase
        rcw_settings iv_raw_card;
        uint8_t iv_dram_width;
        uint8_t iv_dram_die_count;

    public:
        uint64_t iv_freq;
        int64_t iv_tCK_in_ps;
        spd::facade iv_spd_decoder;
        uint8_t iv_dram_density;

        // Assists testing with write ability on these MRW
        // settings that are normally NOT writable
        // using attribute accessors
        // Could create getters & setters...
        uint8_t iv_refresh_mode;
        uint8_t iv_refresh_rate_request;

        ///
        ///@brief Encoding for QSID for RC08,
        ///@note  placing here so we can use the enum for calculate_chip_id and for RCBX
        ///
        enum qsid
        {
            ALL_ENABLE = 0b00,
            ZERO_ENABLE = 0b10,
            ZERO_ONE_ENABLE = 0b01,
            ALL_DISABLE = 0b11,

        };

        // eff_config SPD raw values to attribute mappings
        static const std::vector<std::pair<uint8_t, uint8_t> > DEVICE_WIDTH_MAP;
        static const std::vector<std::pair<uint8_t, uint8_t> > SDRAM_DENSITY_MAP;
        static const std::vector<std::pair<uint8_t, uint8_t> > SOFT_PPR_MAP;
        static const std::vector<std::pair<uint8_t, uint8_t> > BUS_WIDTH_MAP;
        static const std::vector< std::pair<uint8_t, uint8_t> > BANK_ADDR_BITS_MAP;
        static const std::vector<std::pair<uint8_t, uint8_t> > ROW_ADDRESS_BITS_MAP;
        static const std::vector<std::pair<uint8_t, uint8_t> > PRIM_DIE_COUNT_MAP;
        static const std::vector<std::pair<uint8_t, uint8_t> > SEC_DIE_COUNT_MAP;

        //Delete the default
        eff_dimm () = delete;

        ///
        /// @brief constructor for the base eff_dimm class
        /// @param[in] i_spd_decoder the SPD decoder
        /// @param[out] o_rc fapi2::ReturnCode
        /// @note also sets class variables for parent MCA/ MCS and for freqs
        ///
        eff_dimm( const spd::facade& i_spd_decoder,
                  const rcw_settings& i_rcw,
                  fapi2::ReturnCode& o_rc ):
            iv_raw_card(i_rcw),
            iv_spd_decoder(i_spd_decoder)
        {
            // Targeting and index info
            iv_dimm = i_spd_decoder.get_dimm_target();
            FAPI_DBG("Constructing eff_dimm object for %s", mss::c_str(iv_dimm));

            iv_mca = find_target<fapi2::TARGET_TYPE_MCA>(iv_dimm);
            iv_mcs = find_target<fapi2::TARGET_TYPE_MCS>(iv_dimm);
            iv_port_index = mss::index(iv_mca);
            iv_dimm_index = mss::index(iv_dimm);

            // Set widely used parameters
            FAPI_TRY( spd::get_timebases(iv_spd_decoder, iv_mtb, iv_ftb) );
            FAPI_TRY( set_dram_width_instance() );
            FAPI_TRY( set_prim_dram_die_count_instance() );
            FAPI_TRY( set_dram_density_instance() );
            FAPI_TRY( clock_period(iv_dimm, iv_tCK_in_ps), "Failed to calculate clock period (tCK)" );
            FAPI_TRY( mss::mrw_refresh_rate_request(iv_refresh_rate_request), "Failed mrw_temp_refresh_rate_request()" );
            FAPI_TRY( mss::mrw_fine_refresh_mode(iv_refresh_mode), "Failed mrw_fine_refresh_mode()" );
            FAPI_TRY( mss::freq(find_target<fapi2::TARGET_TYPE_MCBIST>(iv_dimm), iv_freq),
                      "Failed accessing mss::freq in eff_dimm");

            FAPI_INF("Calculated clock period - tCK (ps): %d for %s", iv_tCK_in_ps, mss::c_str(iv_dimm));
            FAPI_INF("Calculated frequency (ps): %d for %s", iv_freq, mss::c_str(iv_dimm));

        fapi_try_exit:
            o_rc = fapi2::current_err;
            return;
        }

        ///
        /// @brief Grab the VPD blobs and decode into attributes
        /// @param[in] i_target FAPI2 target (MCS)
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        static fapi2::ReturnCode decode_vpd(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target);

        ///
        /// @brief factory to make an eff_config DIMM object based on dimm kind (type, gen, and revision number)
        /// @param[in] i_spd_decoder the SPD decoder
        /// @param[out] o_fact_obj a shared pointer of the eff_dimm type
        ///
        static fapi2::ReturnCode factory ( const spd::facade& i_spd_decoder,
                                           std::shared_ptr<eff_dimm>& o_fact_obj);

        ///
        /// @brief Determines & sets effective config for buffer and rev type
        /// @param[in] i_target FAPI2 target
        /// @param[in] i_spd_decoder the SPD decoder
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        static fapi2::ReturnCode register_and_buffer_type( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
                const spd::facade& i_spd_decoder );

        ///
        /// @brief Default destructor
        ///
        virtual ~eff_dimm() = default;

        ///
        /// @brief Determines & sets effective config for eff_dram_mfg_id type from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_mfg_id();

        ///
        /// @brief Determines & sets effective config for eff_rcd_mfg_id type from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode rcd_mfg_id();

        ///
        /// @brief Determines & sets effective config for eff_register_type from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode register_type();

        ///
        /// @brief Determines & sets effective config for eff_register_rev type from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode register_rev();

        ///
        /// @brief Determines & sets effective config for primary stack type
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode primary_stack_type();

        ///
        /// @brief Determines & sets effective config for refresh interval time (tREFI)
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_trefi();

        ///
        /// @brief Determines & sets effective config for refresh cycle time (tRFC)
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_trfc();

        ///
        /// @brief Determines & sets effective config for refresh cycle time (logical ranks) (tRFC_DLR)
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_trfc_dlr();

        ///
        /// @brief Determines & sets effective config for dram density
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_density();

        ///
        /// @brief Determines & sets effective config for dram width
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_width();
        ///
        /// @brief Determines & sets effective config for dimm rcd mirror mode
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode rcd_mirror_mode();

        ///
        /// @brief Determines & sets effective config for dimm size
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_size();

        ///
        /// @brief Determines & sets effective config for dram bank bits
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_bank_bits();

        ///
        /// @brief Determines & sets effective config for dram row bits
        ///  @param[in] i_target FAPI2 target
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_row_bits();

        ///
        /// @brief Determines & sets effective config for the die count for the DIMM
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode prim_die_count();

        ///
        /// @brief Determines & sets effective config for number of ranks per dimm
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode ranks_per_dimm();

        ///
        /// @brief Determines & sets effective config for number of master ranks per dimm
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode master_ranks_per_dimm();

        ///
        /// @brief Determines & sets effective config for tDQS
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_dqs_time();

        ///
        /// @brief Determines & sets effective config for DRAM output driver impedance control
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dram_odic() = 0;

        ///
        /// @brief Determines & sets effective config for tCCD_L
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_tccd_l();

        ///
        /// @brief Determines & sets effective config for DIMM RC00
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc00();

        ///
        /// @brief Determines & sets effective config for DIMM RC01
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc01();

        ///
        /// @brief Determines & sets effective config for DIMM RC02
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc02();

        ///
        /// @brief Determines & sets effective config for DIMM RC03
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc03();

        ///
        /// @brief Determines & sets effective config for DIMM RC04
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc04();

        ///
        /// @brief Determines & sets effective config for DIMM RC05
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc05();

        ///
        /// @brief Determines & sets effective config for DIMM RC06_07
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc06_07();

        ///
        /// @brief Determines how many chip select ID bits are needed for the iv_dimm
        /// @param[out] o_qs a qsid encoding denoting if 0, 1, 2, or all three QSID's are needed
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode calculate_chip_ids( qsid& o_qs);

        ///
        /// @brief Determines & sets effective config for DIMM RC08
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc08();

        ///
        /// @brief Determines & sets effective config for DIMM RC09
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc09();

        ///
        /// @brief Determines & sets effective config for DIMM RC0A
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc0a();

        ///
        /// @brief Determines & sets effective config for DIMM RC0B
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc0b();

        ///
        /// @brief Determines & sets effective config for DIMM RC0C
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc0c();

        ///
        /// @brief Determines & sets effective config for DIMM RC0D
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc0d();

        ///
        /// @brief Determines & sets effective config for DIMM RC0E
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc0e();

        ///
        /// @brief Determines & sets effective config for DIMM RC0F
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc0f();

        ///
        /// @brief Determines & sets effective config for DIMM RC_1x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc1x();

        ///
        /// @brief Determines & sets effective config for DIMM RC_2x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc2x();

        ///
        /// @brief Determines & sets effective config for DIMM RC_3x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc3x();

        ///
        /// @brief Determines & sets effective config for DIMM RC_4x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc4x();

        ///
        /// @brief Determines & sets effective config for DIMM RC_5x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc5x();

        ///
        /// @brief Determines & sets effective config for DIMM RC_6x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc6x();

        ///
        /// @brief Determines & sets effective config for DIMM RC_7x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc7x();

        ///
        /// @brief Determines & sets effective config for DIMM RC_8x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc8x();

        ///
        /// @brief Determines & sets effective config for DIMM RC_9x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rc9x();


        ///
        /// @brief Determines & sets effective config for DIMM RC_AX
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rcax();


        ///
        /// @brief Determines & sets effective config for DIMM RC_BX
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_rcbx();

        ///
        /// @brief Determines & sets effective config for tWR
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_twr();

        ///
        /// @brief Determines & sets effective config for RBT
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode read_burst_type();

        ///
        /// @brief Determines & sets effective config for TM
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_tm();

        ///
        /// @brief Determines & sets effective config for cwl
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_cwl();

        ///
        /// @brief Determines & sets effective config for lpasr
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_lpasr();

        ///
        /// @brief Determines & sets effective config for additive latency
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode additive_latency();

        ///
        /// @brief Determines & sets effective config for DLL Reset
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dll_reset();

        ///
        /// @brief Determines & sets effective config for DLL Enable
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dll_enable();

        ///
        /// @brief Determines & sets effective config for Write Level Enable
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode write_level_enable();

        ///
        /// @brief Determines & sets effective config for Output Buffer
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note The value and range attributes are combined as offsetting the WR VREF percentage can cause both the value and range to shift
        /// The calculations would have to be done twice if the calculations were done separately. As such, they are combined below
        ///
        fapi2::ReturnCode output_buffer();


        ///
        /// @brief Determines & sets effective config for Vref DQ Train Value and Range
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode vref_dq_train_value_and_range();

        ///
        /// @brief Determines & sets effective config for Vref DQ Train Enable
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode vref_dq_train_enable();

        ///
        /// @brief Determines & sets effective config for CA Parity Latency
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode ca_parity_latency();

        ///
        /// @brief Determines & sets effective config for CA Parity
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode ca_parity();

        ///
        /// @brief Determines & sets effective config for CRC Error Clear
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode crc_error_clear();

        ///
        /// @brief Determines & sets effective config for CA Parity Error Status
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode ca_parity_error_status();

        ///
        /// @brief Determines & sets effective config for ODT Input Buffer
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode odt_input_buffer();

        ///
        /// @brief Determines & sets effective ODT write values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode odt_wr() = 0;

        ///
        /// @brief Determines & sets effective ODT read values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode odt_rd() = 0;

        ///
        /// @brief Determines & sets effective PHY RLO values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode phy_rlo() = 0;

        ///
        /// @brief Determines & sets effective PHY WLO values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode phy_wlo() = 0;

        ///
        /// @brief Determines & sets effective config for data_mask
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode data_mask();

        ///
        /// @brief Determines & sets effective config for write_dbi
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode write_dbi();

        ///
        /// @brief Determines & sets effective config for read_dbi
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode read_dbi();

        ///
        /// @brief Determines & sets effective config for Post Package Repair
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode post_package_repair();

        ///
        /// @brief Determines & sets effective config for Soft Post Package Repair
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode soft_post_package_repair();

        ///
        /// @brief Determines & sets effective config for rd_preamble_train
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode read_preamble_train();

        ///
        /// @brief Determines & sets effective config for rd_preamble
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode read_preamble();

        ///
        /// @brief Determines & sets effective config for wr_preamble
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode write_preamble();

        ///
        /// @brief Determines & sets effective config for self_ref_abort
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode self_refresh_abort();

        ///
        /// @brief Determines & sets effective config for cs_cmd_latency
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode cs_to_cmd_addr_latency();

        ///
        /// @brief Determines & sets effective config for int_vref_mon
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode internal_vref_monitor();

        ///
        /// @brief Determines & sets effective config for powerdown_mode
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode max_powerdown_mode();

        ///
        /// @brief Determines & sets effective config for mpr_rd_format
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode mpr_read_format();

        ///
        /// @brief Determines & sets effective config for CRC write latency
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode crc_wr_latency();

        ///
        /// @brief Determines & sets effective config for temperature readout
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode temp_readout();

        ///
        /// @brief Determines & sets effective config for per DRAM addressability
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode per_dram_addressability();

        ///
        /// @brief Determines & sets effective config for geardown mode
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode geardown_mode();

        ///
        /// @brief Determines & sets effective config for geardown mode
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode mpr_page();

        ///
        /// @brief Determines & sets effective config for MPR mode
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode mpr_mode();

        ///
        /// @brief Determines & sets effective config for write CRC
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode write_crc();

        ///
        /// @brief Determines & sets effective config for ZQ Calibration
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode zqcal_interval();

        ///
        /// @brief Determines & sets effective config for MEMCAL Calibration
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode memcal_interval();

        ///
        /// @brief Determines & sets effective config for tRP
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_trp();

        ///
        /// @brief Determines & sets effective config for tRCD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_trcd();

        ///
        /// @brief Determines & sets effective config for tRC
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_trc();

        ///
        /// @brief Determines & sets effective config for tWTR_L
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_twtr_l();

        ///
        /// @brief Determines & sets effective config for tWTR_S
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_twtr_s();

        ///
        /// @brief Determines & sets effective config for the nibble map
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode nibble_map();

        ///
        /// @brief Determines & sets effective config for the package rank map
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode package_rank_map();

        ///
        /// @brief Determines & sets effective config for the wr_crc
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode wr_crc();

        ///
        /// @brief Determines & sets effective config for tRRD_S (tRRD_S_slr)
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_trrd_s();

        ///
        /// @brief Determines & sets effective config for tRRD_L (or tRRD_L_slr)
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_trrd_l();

        ///
        /// @brief Determines & sets effective config for tRRD_DLR
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_trrd_dlr();

        ///
        /// @brief Determines & sets effective config for tFAW (or tFAW_slr)
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_tfaw();

        ///
        /// @brief Determines & sets effective config for tFAW_DLR
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_tfaw_dlr();

        ///
        /// @brief Determines & sets effective config for tRAS
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_tras();

        ///
        /// @brief Determines & sets effective config for tRTP
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dram_trtp();

        ///
        /// @brief Determines and sets the cal_step_enable values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode cal_step_enable();

        ///
        /// @brief Determines and sets the rdvref_enable_bit settings
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode rdvref_enable_bit();

        ///
        /// @brief Determines and sets the ATTR_MSS_CUSTOM_TRAINING_ADV_PATTERNS settings
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note overwrite the attribute to default values if it's set to 0
        ///
        fapi2::ReturnCode training_adv_pattern();

        ///
        /// @brief Determines and sets the ATTR_MSS_CUSTOM_TRAINING_ADV_BACKUP_PATTERNS settings
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note overwrite the attribute to default values if it's set to 0
        ///
        fapi2::ReturnCode training_adv_backup_pattern();

        ///
        /// @brief Determines and sets the ATTR_MSS_CUSTOM_TRAINING_ADV_BACKUP_PATTERNS2 settings
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note overwrite the attribute to default values if it's set to 0
        ///
        fapi2::ReturnCode training_adv_backup_pattern2();

        ///
        /// @brief Determines and sets the ATTR_MSS_CUSTOM_TRAINING_ADV_WR_PATTERN settings
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note overwrite the attribute to default values if it's set to 0
        ///
        fapi2::ReturnCode training_adv_wr_pattern();

        ///
        /// @brief Determines and sets ATTR_MSS_PHY_SEQ_REFRESH_
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode phy_seq_refresh();

        ///
        /// @brief Sets the RTT_NOM value from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note used for MRS01
        ///
        virtual fapi2::ReturnCode dram_rtt_nom() = 0;

        ///
        /// @brief Sets the RTT_NOM value from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note used for MRS02
        ///
        virtual fapi2::ReturnCode dram_rtt_wr() = 0;

        ///
        /// @brief Sets the RTT_PARK value from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note used for MRS05
        ///
        virtual fapi2::ReturnCode dram_rtt_park() = 0;

        ///
        /// @brief Sets the LRDIMM training pattern
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode lrdimm_training_pattern() = 0;

        ///
        /// @brief Determines and sets DIMM BC00
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc00() = 0;

        ///
        /// @brief Determines and sets DIMM BC01
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc01() = 0;

        ///
        /// @brief Determines and sets DIMM BC02
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc02() = 0;

        ///
        /// @brief Determines and sets DIMM BC03
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc03() = 0;

        ///
        /// @brief Determines and sets DIMM BC04
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc04() = 0;

        ///
        /// @brief Determines and sets DIMM BC05
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc05() = 0;

        ///
        /// @brief Determines and sets DIMM BC06
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc06() = 0;

        ///
        /// @brief Determines and sets DIMM BC07
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc07() = 0;

        ///
        /// @brief Determines and sets DIMM BC08
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc08() = 0;


        ///
        /// @brief Determines and sets DIMM BC09
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc09() = 0;

        ///
        /// @brief Determines and sets DIMM BC0a
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0a() = 0;

        ///
        /// @brief Determines and sets DIMM BC0b
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0b() = 0;

        ///
        /// @brief Determines and sets DIMM BC0c
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0c() = 0;

        ///
        /// @brief Determines and sets DIMM BC0d
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0d() = 0;

        ///
        /// @brief Determines and sets DIMM BC0e
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0e() = 0;

        ///
        /// @brief Determines and sets DIMM BC0f
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0f() = 0;

        ///
        /// @brief Determines and sets DIMM F0BC1x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f0bc1x() = 0;

        ///
        /// @brief Determines and sets DIMM F0BC6x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f0bc6x() = 0;

        ///
        /// @brief Determines and sets DIMM F2BCEx
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f2bcex() = 0;

        ///
        /// @brief Determines and sets DIMM F5BC5x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f5bc5x() = 0;

        ///
        /// @brief Determines and sets DIMM F5BC6x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f5bc6x() = 0;


        ///
        /// @brief Determines and sets DIMM F6BC4x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f6bc4x() = 0;

    private:

        ///
        /// @brief Returns Logical ranks in Primary SDRAM type
        /// @param[out] o_logical_ranks number of logical ranks
        /// @return fapi2::FAPI2_RC_SUCCESS iff okay
        ///
        fapi2::ReturnCode prim_sdram_logical_ranks( uint8_t& o_logical_ranks ) const;

        ///
        /// @brief Helper function that returns Logical ranks in SDRAM type
        /// @param[out] o_logical_ranks number of logical ranks
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode sec_sdram_logical_ranks( uint8_t& o_logical_ranks ) const;

        ///
        /// @brief Returns Logical ranks per DIMM
        /// @param[out] o_logical_ranks number of logical ranks
        /// @return fapi2::FAPI2_RC_SUCCESS iff okay
        ///
        fapi2::ReturnCode logical_ranks_per_dimm( uint8_t& o_logical_rank_per_dimm ) const;

        ///
        /// @brief Helper function to set dram width instance variable
        /// @return fapi2::FAPI2_RC_SUCCESS iff okay
        ///
        fapi2::ReturnCode set_dram_width_instance();

        ///
        /// @brief Helper function to set dram density instance variable
        /// @return fapi2::FAPI2_RC_SUCCESS iff okay
        ///
        fapi2::ReturnCode set_dram_density_instance();

        ///
        /// @brief Helper function to set dram density instance variable
        /// @return fapi2::FAPI2_RC_SUCCESS iff okay
        ///
        fapi2::ReturnCode set_prim_dram_die_count_instance();
};

///
/// @class mss::dimm::eff_lrdimm : eff_dimm
/// @brief A class made to perform eff_config functions for DDR4 LRDIMMS
/// @note this is a subclass of eff_dimm and parent class to eff_lrdimm_db01 and eff_lrdimm_db02
///
class eff_lrdimm : public eff_dimm
{
    protected:
        uint8_t iv_master_ranks_index;

    public:
        enum
        {
            NUM_VALID_RANKS_CONFIGS = 2,
        };


        ///
        /// @brief constructor for the eff_lrdimm class
        /// @param[in] i_spd_decoder the SPD decoder
        /// @param[in] i_rcw the RCW settings for this DIMM
        /// @param[in] i_master_ranks the number of master ranks on this DIMM
        /// @param[out] o_rc fapi2::ReturnCode
        /// @note also sets class variables for parent MCA/ MCS and for freqs
        /// @note calls eff_dimm ctor
        ///
        eff_lrdimm( const spd::facade& i_spd_decoder,
                    const rcw_settings& i_rcw,
                    const uint8_t i_master_rank,
                    fapi2::ReturnCode& o_rc ):
            eff_dimm ( i_spd_decoder, i_rcw, o_rc ),
            iv_master_ranks_index(master_ranks_to_index(i_master_rank))
        {
            FAPI_DBG("Constructing LRDIMM for %s with %u master ranks", mss::c_str(iv_dimm), i_master_rank);
        }

        ///
        /// @brief Finds the master rank index
        /// @param[in] i_master_rank number of master ranks for this DIMM
        /// @return master rank index - 0 if 2R, 1 otherwise (4R)
        /// @note LRDIMM's should only support 2R and 4R
        /// We use an index to speed up our lookups for LR settings
        ///
        uint8_t master_ranks_to_index(const uint8_t i_master_rank) const
        {
            return i_master_rank == 2 ? 0 : 1;
        }

        ///
        /// @brief Sets the master rank index based upon the number of master ranks
        /// @param[in] i_master_rank the number of master ranks on this DIMM
        ///
        void set_master_rank_index(const uint8_t i_master_rank)
        {
            iv_master_ranks_index = master_ranks_to_index(i_master_rank);
        }

        ///
        /// @brief default destructor
        ///
        virtual ~eff_lrdimm() = default;


        ///
        /// @brief Determines & sets effective config for Vref DQ Train Value and Range
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode vref_dq_train_value_and_range() final;

        ///
        /// @brief Determines & sets effective ODT write values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode odt_wr() final;

        ///
        /// @brief Determines & sets effective ODT read values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode odt_rd() final;

        ///
        /// @brief Determines & sets effective PHY RLO values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode phy_rlo() final;

        ///
        /// @brief Determines & sets effective PHY WLO values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode phy_wlo() final;


        ///
        /// @brief Sets the RTT_NOM value from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note used for MRS01
        ///
        virtual fapi2::ReturnCode dram_rtt_nom() final;

        ///
        /// @brief Sets the RTT_NOM value from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note used for MRS02
        ///
        virtual fapi2::ReturnCode dram_rtt_wr() final;

        ///
        /// @brief Sets the RTT_PARK value from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note used for MRS05
        ///
        virtual fapi2::ReturnCode dram_rtt_park() final;

        ///
        /// @brief Determines & sets effective config for DRAM output driver impedance control
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dram_odic() final;

        ///
        /// @brief Sets the LRDIMM training pattern
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode lrdimm_training_pattern() final;

        ///
        /// @brief Determines and sets DIMM BC00
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc00() final;

        ///
        /// @brief Determines and sets DIMM BC01
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc01() final;

        ///
        /// @brief Determines and sets DIMM BC02
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc02() final;

        ///
        /// @brief Determines and sets DIMM BC03
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc03() = 0;

        ///
        /// @brief Determines and sets DIMM BC04
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc04() final;

        ///
        /// @brief Determines and sets DIMM BC05
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc05() final;

        ///
        /// @brief Determines and sets DIMM BC09
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc06() final;

        ///
        /// @brief Determines and sets DIMM BC07
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc07() final;

        ///
        /// @brief Determines and sets DIMM BC08
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc08() final;

        ///
        /// @brief Determines and sets DIMM BC09
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc09() final;

        ///
        /// @brief Determines and sets DIMM BC0a
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0a() final;

        ///
        /// @brief Determines and sets DIMM BC0b
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0b() = 0;

        ///
        /// @brief Determines and sets DIMM BC0c
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0c() = 0;

        ///
        /// @brief Determines and sets DIMM BC0d
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0d() = 0;

        ///
        /// @brief Determines and sets DIMM BC0e
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0e() final;

        ///
        /// @brief Determines and sets DIMM BC0f
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0f() final;

        ///
        /// @brief Determines and sets DIMM F0BC1x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f0bc1x() final;

        ///
        /// @brief Determines and sets DIMM F0BC6x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f0bc6x() final;

        ///
        /// @brief Determines and sets DIMM F2BCex
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f2bcex() final;

        ///
        /// @brief Determines and sets DIMM F5BC5x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f5bc5x() final;

        ///
        /// @brief Determines and sets DIMM F5BC6x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f5bc6x() final;

        ///
        /// @brief Determines and sets DIMM F6BC4x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f6bc4x() final;
};

///
/// @class mss::dimm::eff_lrdimm_db01 : eff_lrdimm
/// @brief A class made to perform eff_config functions for DDR4 LRDIMMS with Databuffer type 01
///
class eff_lrdimm_db01 : public eff_lrdimm
{
    protected:
    public:
        //Delete default
        eff_lrdimm_db01() = delete;

        ///
        /// @brief constructor for the eff_lrdimm_db01 (LRDIMM DataBuffer 1) class
        /// @param[in] i_spd_decoder the SPD decoder
        /// @param[in] i_rcw the RCW settings for this DIMM
        /// @param[in] i_master_ranks the number of master ranks on this DIMM
        /// @param[out] o_rc fapi2::ReturnCode
        /// @note also sets class variables for parent MCA/ MCS and for freqs
        /// @note calls eff_dimm ctor
        ///
        eff_lrdimm_db01( const spd::facade& i_spd_decoder,
                         const rcw_settings& i_rcw,
                         const uint8_t i_master_rank,
                         fapi2::ReturnCode& o_rc ) :
            eff_lrdimm( i_spd_decoder, i_rcw, i_master_rank, o_rc )
        {
            FAPI_DBG("Constructing LRDIMM_DB01 for %s", mss::c_str(iv_dimm))
        }

        ///
        /// @brief default destructor
        ///
        ~eff_lrdimm_db01() = default;

        ///
        /// @brief Determines and sets DIMM BC03
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc03();

        ///
        /// @brief Determines and sets DIMM BC0b
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0b();


        ///
        /// @brief Determines and sets DIMM BC0c
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0c();

        ///
        /// @brief Determines and sets DIMM BC0d
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0d();
};

///
/// @class mss::dimm::eff_lrdimm_db02 : eff_lrdimm
/// @brief A class made to perform eff_config functions for DDR4 LRDIMMS with Databuffer type 02
///
class eff_lrdimm_db02 : public eff_lrdimm
{
    protected:
    public:
        //Delete default
        eff_lrdimm_db02() = delete;

        ///
        /// @brief constructor for the eff_lrdimm_db02 (LRDIMM DataBuffer 2) class
        /// @param[in] i_spd_decoder the SPD decoder
        /// @param[in] i_rcw the RCW settings for this DIMM
        /// @param[in] i_master_ranks the number of master ranks on this DIMM
        /// @param[out] o_rc fapi2::ReturnCode
        /// @note also sets class variables for parent MCA/ MCS and for freqs
        /// @note calls eff_dimm ctor
        ///
        eff_lrdimm_db02( const spd::facade& i_spd_decoder,
                         const rcw_settings& i_rcw,
                         const uint8_t i_master_rank,
                         fapi2::ReturnCode& o_rc ) :
            eff_lrdimm( i_spd_decoder, i_rcw, i_master_rank, o_rc )
        {
            FAPI_DBG("Constructing LRDIMM_DB02 for %s", mss::c_str(iv_dimm));
        }

        ///
        /// @brief default destructor
        ///
        ~eff_lrdimm_db02() = default;

        ///
        /// @brief Determines and sets DIMM BC03
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc03();

        ///
        /// @brief Determines and sets DIMM BC0b
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0b();

        ///
        /// @brief Determines and sets DIMM BC0c
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0c();

        ///
        /// @brief Determines and sets DIMM BC0d
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_bc0d();
};

///
/// @class mss::dimm::eff_rdimm : eff_dimm
/// @brief A class made to perform eff_config functions for DDR4 RDIMMS
///
class eff_rdimm : public eff_dimm
{
    public:
        eff_rdimm() = delete;

        ///
        /// @brief constructor for the eff_rdimm_db01 (LRDIMM DataBuffer 1) class
        /// @param[in] i_spd_decoder the SPD decoder
        /// @param[out] o_rc fapi2::ReturnCode
        /// @note also sets class variables for parent MCA/ MCS and for freqs
        /// @note calls eff_dimm ctor
        ///
        eff_rdimm( const spd::facade& i_spd_decoder,
                   const rcw_settings& i_rcw,
                   fapi2::ReturnCode& o_rc ) :
            eff_dimm( i_spd_decoder, i_rcw, o_rc )
        {
            FAPI_DBG("Constructing RDIMM for %s", mss::c_str(iv_dimm));
        }

        ///
        /// @brief default destructor
        ///
        ~eff_rdimm() = default;

        ///
        /// @brief Determines & sets effective ODT write values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode odt_wr() final;

        ///
        /// @brief Determines & sets effective ODT read values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode odt_rd() final;

        ///
        /// @brief Determines & sets effective PHY RLO values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode phy_rlo() final;

        ///
        /// @brief Determines & sets effective PHY WLO values
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode phy_wlo() final;


        ///
        /// @brief Sets the RTT_NOM value from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note used for MRS01
        ///
        fapi2::ReturnCode dram_rtt_nom() final;

        ///
        /// @brief Sets the RTT_NOM value from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note used for MRS02
        ///
        fapi2::ReturnCode dram_rtt_wr() final;

        ///
        /// @brief Sets the RTT_PARK value from SPD
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        /// @note used for MRS05
        ///
        fapi2::ReturnCode dram_rtt_park() final;

        ///
        /// @brief Determines & sets effective config for DRAM output driver impedance control
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dram_odic() final;

        ///
        /// @brief Sets the LRDIMM training pattern
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode lrdimm_training_pattern()
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC00
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc00() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC01
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc01() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC02
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc02() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC03
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc03() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC04
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc04() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC05
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc05() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC06
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc06() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC07
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc07() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC08
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc08() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC09
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc09() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC0a
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc0a() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC0b
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc0b() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC0c
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc0c() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC0d
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc0d() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC0e
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc0e() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM BC0f
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        fapi2::ReturnCode dimm_bc0f() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM F0BC1x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f0bc1x() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM F0BC6x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f0bc6x() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM F2BCEx
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f2bcex() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM F5BC5x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f5bc5x() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }

        ///
        /// @brief Determines and sets DIMM F5BC6x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f5bc6x() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }


        ///
        /// @brief Determines and sets DIMM F6BC4x
        /// @return fapi2::FAPI2_RC_SUCCESS if okay
        ///
        virtual fapi2::ReturnCode dimm_f6bc4x() final
        {
            return fapi2::FAPI2_RC_SUCCESS;
        }
};
}//mss

#endif
OpenPOWER on IntegriCloud