summaryrefslogtreecommitdiffstats
path: root/src/usr/isteps/istep07/call_mss_eff_config.C
blob: 00ebcc429caafd61560fffc5d8db5f3a31075dae (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/isteps/istep07/call_mss_eff_config.C $                */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2015,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                                                     */
/**
 *  @file call_mss_eff_config.C
 *  Contains the wrapper for mss_eff_config istep
 */

/******************************************************************************/
// Includes
/******************************************************************************/

// STD
#include    <stdint.h>
#include    <stdlib.h>
#include    <map>

// Generated
#include    <attributeenums.H>
#include    <config.h>

// Errors and Tracing Support
#include    <trace/interface.H>
#include    <initservice/taskargs.H>
#include    <initservice/isteps_trace.H>
#include    <errl/errlentry.H>
#include    <errl/errludtarget.H>
#include    <isteps/hwpisteperror.H>
#include    <hbotcompid.H>

// Pnor Support
#include    <pnor/pnorif.H>

// Targeting Support
#include    <targeting/common/commontargeting.H>
#include    <targeting/common/utilFilter.H>

// Fapi Support
#include    <fapi2.H>
#include    <fapi2/plat_hwp_invoker.H>

// Nimbus Specific HWPs
#include    <p9_mss_eff_config.H>
#include    <p9_mss_eff_config_thermal.H>
#include    <p9_mss_eff_grouping.H>

// Cumulus Specific HWPs
#include    <p9c_mss_eff_config.H>
#include    <p9c_mss_eff_mb_interleave.H>
#include    <p9c_mss_eff_config_thermal.H>

// Axone Specific HWPs
#ifdef CONFIG_AXONE
#include    <p9a_mss_eff_config.H>
#include    <exp_mss_eff_config_thermal.H>
#endif

// SMF Support
#include    <secureboot/smf.H>

// NVDIMM Support
#include    <nvram/nvram_interface.H>



namespace   ISTEP_07
{

using   namespace   ISTEP;
using   namespace   ISTEP_ERROR;
using   namespace   ERRORLOG;
using   namespace   TARGETING;

errlHndl_t call_mss_eff_grouping(IStepError & io_istepErr)
{
    errlHndl_t l_err = nullptr;

    TARGETING::TargetHandleList l_procsList;
    getAllChips(l_procsList, TYPE_PROC);

    for (const auto & l_cpu_target : l_procsList)
    {
        //  print call to hwp and write HUID of the target(s)
        TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
            "p9_mss_eff_grouping HWP cpu target HUID %.8X",
            TARGETING::get_huid(l_cpu_target));

        // cast OUR type of target to a FAPI type of target.
        const fapi2::Target <fapi2::TARGET_TYPE_PROC_CHIP> l_fapi_cpu_target
            (l_cpu_target);

        FAPI_INVOKE_HWP(l_err, p9_mss_eff_grouping, l_fapi_cpu_target);

        //  process return code.
        if ( l_err )
        {
            TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
               "ERROR 0x%.8X:  p9_mss_eff_grouping HWP on target %.8x",
                l_err->reasonCode(), TARGETING::get_huid(l_cpu_target));

            // capture the target data in the elog
            ErrlUserDetailsTarget(l_cpu_target).addToLog(l_err);
            io_istepErr.addErrorDetails(l_err);
            errlCommit(l_err, ISTEP_COMP_ID);
        }
        else
        {
            TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
               "SUCCESS :  p9_mss_eff_grouping HWP on target %.8x",
                TARGETING::get_huid(l_cpu_target));
        }
    }   // end processor list processing

    return l_err;
}


errlHndl_t call_mss_eff_mb_interleave()
{
    errlHndl_t l_err = NULL;

    TARGETING::TargetHandleList l_membufTargetList;
    getAllChips(l_membufTargetList, TYPE_MEMBUF);

    for (const auto & l_membuf_target : l_membufTargetList)
    {
        TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                "=====  Running p9c_mss_eff_mb_interleave HWP on HUID %.8X",
                TARGETING::get_huid(l_membuf_target));

        fapi2::Target <fapi2::TARGET_TYPE_MEMBUF_CHIP> l_membuf_fapi_target
                (l_membuf_target);

        FAPI_INVOKE_HWP(l_err, p9c_mss_eff_mb_interleave, l_membuf_fapi_target);

        if (l_err)
        {
            TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                      "ERROR 0x%.8X: p9c_mss_eff_mb_interleave HWP returns error",
                      l_err->reasonCode());
            ErrlUserDetailsTarget(l_membuf_target).addToLog(l_err);
            break;
        }
        else
        {
            TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                      "Successfully ran p9c_mss_eff_mb_interleave HWP on HUID %.8X",
                      TARGETING::get_huid(l_membuf_target));
        }
    }
    return l_err;
}


//
//  Wrapper function to call mss_eff_config
//
void*    call_mss_eff_config( void *io_pArgs )
{
    IStepError l_StepError;
    errlHndl_t l_err = nullptr;
#if (defined CONFIG_SECUREBOOT && ! defined CONFIG_AXONE)
    auto memdLoaded = false;
#endif

    do {

    #if (defined CONFIG_SECUREBOOT && ! defined CONFIG_AXONE)
    // MEMD used by p9_mss_eff_config HWP
    l_err = loadSecureSection(PNOR::MEMD);
    if (l_err)
    {
        TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
            ERR_MRK "Failed in call to loadSecureSection for section "
            "PNOR:MEMD");

        // Create istep error and link it to PLID of original error
        l_StepError.addErrorDetails(l_err);
        errlCommit(l_err, ISTEP_COMP_ID);
        break;
    }
    memdLoaded = true;
    #endif

    TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_eff_config entry" );

    TARGETING::ATTR_MODEL_type l_procModel = TARGETING::targetService().getProcessorModel();

    TARGETING::Target* l_sys = nullptr;
    targetService().getTopLevelTarget(l_sys);
    assert( l_sys != nullptr );

    TARGETING::TargetHandleList l_membufTargetList;
    TARGETING::TargetHandleList l_mcsTargetList;
    TARGETING::TargetHandleList l_memportTargetList;
    std::vector<fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>> l_fapi_ocmb_targets;

    //TODO RTC: 202491 Ensure endianess in simics matches hardware
    l_sys->setAttr<TARGETING::ATTR_MSS_OCMB_EXP_STRUCT_MMIO_ENDIAN_CTRL>(fapi2::ENUM_ATTR_MSS_OCMB_EXP_STRUCT_MMIO_ENDIAN_CTRL_NO_SWAP);
    l_sys->setAttr<TARGETING::ATTR_MSS_OCMB_EXP_STRUCT_ENDIAN>(fapi2::ENUM_ATTR_MSS_OCMB_EXP_STRUCT_ENDIAN_LITTLE_ENDIAN);

    if(l_procModel == TARGETING::MODEL_CUMULUS)
    {
        // Get all Centaur targets
        getAllChips(l_membufTargetList, TYPE_MEMBUF);

        for (TargetHandleList::const_iterator
            l_membuf_iter = l_membufTargetList.begin();
            l_membuf_iter != l_membufTargetList.end();
            ++l_membuf_iter)
        {
            //  make a local copy of the target for ease of use
            TARGETING::Target* l_pCentaur = *l_membuf_iter;
            TARGETING::TargetHandleList l_mbaTargetList;
            getChildChiplets(l_mbaTargetList,
                            l_pCentaur,
                            TYPE_MBA);
            for (TargetHandleList::const_iterator
                l_mba_iter = l_mbaTargetList.begin();
                l_mba_iter != l_mbaTargetList.end();
                ++l_mba_iter)
            {
              //  Make a local copy of the target for ease of use
              TARGETING::Target*  l_mbaTarget = *l_mba_iter;
              TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                          "p9c_mss_eff_config HWP target HUID %.8x",
                          TARGETING::get_huid(l_mbaTarget));

                //  call the HWP with each target
                fapi2::Target <fapi2::TARGET_TYPE_MBA_CHIPLET> l_fapi_mba_target(l_mbaTarget);

                FAPI_INVOKE_HWP(l_err, p9c_mss_eff_config, l_fapi_mba_target);

                //  process return code.
                if ( l_err )
                {
                    TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                        "ERROR 0x%.8X:  p9c_mss_eff_config HWP on target HUID %.8x",
                        l_err->reasonCode(), TARGETING::get_huid(l_mbaTarget) );

                    // capture the target data in the elog
                    ErrlUserDetailsTarget(l_mbaTarget).addToLog( l_err );

                    // Create IStep error log and cross reference to error that occurred
                    l_StepError.addErrorDetails( l_err );

                    // Commit Error
                    errlCommit( l_err, ISTEP_COMP_ID );
                }
                else
                {
                    TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                        "SUCCESS :  p9c_mss_eff_config HWP");
                }
            } // end mba loop
        }  // end membuf loop
    }
    else if(l_procModel == TARGETING::MODEL_NIMBUS)
    {
        // Get all functional MCS chiplets
        getAllChiplets(l_mcsTargetList, TYPE_MCS);

        // Iterate over all MCS, calling mss_eff_config and mss_eff_config_thermal
        for (const auto & l_mcs_target : l_mcsTargetList)
        {
            // Get the TARGETING::Target pointer and its HUID
            uint32_t l_huid = TARGETING::get_huid(l_mcs_target);

            // Create a FAPI target representing the MCS
            const fapi2::Target <fapi2::TARGET_TYPE_MCS> l_fapi_mcs_target
                (l_mcs_target);

            // Call the mss_eff_config HWP
            TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                "p9_mss_eff_config HWP. MCS HUID %.8X", l_huid);
            FAPI_INVOKE_HWP(l_err, p9_mss_eff_config, l_fapi_mcs_target);

            if (l_err)
            {
                TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                    "ERROR 0x%.8X:  p9_mss_eff_config HWP ", l_err->reasonCode());

                // Ensure istep error created and has same plid as this error
                ErrlUserDetailsTarget(l_mcs_target).addToLog(l_err);
                l_err->collectTrace(EEPROM_COMP_NAME);
                l_err->collectTrace(I2C_COMP_NAME);
                l_StepError.addErrorDetails(l_err);
                errlCommit(l_err, ISTEP_COMP_ID);
            }
            else
            {
                TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                    "SUCCESS :  p9_mss_eff_config HWP");
            }
        } // end mcs loop
    }
#ifdef CONFIG_AXONE
    else if(l_procModel == TARGETING::MODEL_AXONE)
    {
        // Get all functional MEM_PORT chiplets
        getAllChiplets(l_memportTargetList, TYPE_MEM_PORT);

        for(const auto & l_memport_target: l_memportTargetList)
        {
            // Create a FAPI target representing the MEM_PORT target
            const fapi2::Target <fapi2::TARGET_TYPE_MEM_PORT> l_fapi_memport_target
                (l_memport_target);

            const auto l_fapi2_ocmb_target =
                l_fapi_memport_target.getParent<fapi2::TARGET_TYPE_OCMB_CHIP>();

            l_fapi_ocmb_targets.push_back(l_fapi2_ocmb_target);

            TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                      "call p9a_mss_eff_config HWP on MEM_PORT HUID %.8X",
                      TARGETING::get_huid(l_memport_target));

            FAPI_INVOKE_HWP(l_err, p9a_mss_eff_config, l_fapi_memport_target);

            if (l_err)
            {
                TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                          "ERROR 0x%.8X:  p9a_mss_eff_config HWP on target 0x%.08X",
                          l_err->reasonCode(),
                          TARGETING::get_huid(l_memport_target));

                // Ensure istep error created and has same plid as this error
                ErrlUserDetailsTarget(l_memport_target).addToLog(l_err);
                l_err->collectTrace(EEPROM_COMP_NAME);
                l_err->collectTrace(I2C_COMP_NAME);
                l_StepError.addErrorDetails(l_err);
                errlCommit(l_err, ISTEP_COMP_ID);
            }
            else
            {
                TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                          "SUCCESS :  p9a_mss_eff_config HWP on target 0x%.08X",
                          TARGETING::get_huid(l_memport_target));
            }
        } // end mem_port list
    }
#endif

    if(!l_StepError.isNull())
    {
        break;
    }

    l_err = call_mss_eff_mb_interleave();

    if (l_err)
    {
        // Ensure istep error created and has same plid as this error
        l_StepError.addErrorDetails( l_err );
        errlCommit( l_err, ISTEP_COMP_ID);
        break;
    }

    if(l_procModel == TARGETING::MODEL_CUMULUS)
    {
        for (TargetHandleList::const_iterator
            l_membuf_iter = l_membufTargetList.begin();
            l_membuf_iter != l_membufTargetList.end();
            ++l_membuf_iter)
        {
            //  Make a local copy of the target for ease of use
            TARGETING::Target* l_pCentaur = *l_membuf_iter;

            TARGETING::TargetHandleList l_mbaTargetList;
            getChildChiplets(l_mbaTargetList,
                        l_pCentaur,
                        TYPE_MBA);

            for (TargetHandleList::const_iterator
                l_mba_iter = l_mbaTargetList.begin();
                l_mba_iter != l_mbaTargetList.end();
                ++l_mba_iter)
            {
                //  Make a local copy of the target for ease of use
                TARGETING::Target*  l_mbaTarget = *l_mba_iter;
                TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                "p9c_mss_eff_config_thermal HWP target HUID %.8x",
                TARGETING::get_huid(l_mbaTarget));

                //  call the HWP with each target
                fapi2::Target <fapi2::TARGET_TYPE_MBA_CHIPLET> l_fapi_mba_target(l_mbaTarget);

                FAPI_INVOKE_HWP(l_err, p9c_mss_eff_config_thermal, l_fapi_mba_target);

                //  process return code.
                if ( l_err )
                {
                    TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                    "ERROR 0x%.8X:  p9c_mss_eff_config_thermal HWP on target HUID %.8x",
                    l_err->reasonCode(), TARGETING::get_huid(l_mbaTarget) );

                    // capture the target data in the elog
                    ErrlUserDetailsTarget(l_mbaTarget).addToLog( l_err );

                    // Create IStep error log and cross reference to error that occurred
                    l_StepError.addErrorDetails( l_err );

                    // Commit Error
                    errlCommit( l_err, ISTEP_COMP_ID );
                }
                else
                {
                    TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                    "SUCCESS :  p9c_mss_eff_config_thermal HWP");
                }
            }
        }
    }
    else if(l_procModel == TARGETING::MODEL_NIMBUS)
    {
        std::map<ATTR_VDDR_ID_type,TARGETING::TargetHandleList> l_domainIdGroups;
        TARGETING::TargetHandleList l_mcbistTargetList;
        getAllChiplets(l_mcbistTargetList, TYPE_MCBIST);

        // Iterate over all MCBIST, calling mss_eff_config_thermal
        for (const auto & l_mcbist_target : l_mcbistTargetList)
        {
            TARGETING::TargetHandleList l_mcsChildren;
            getChildChiplets(l_mcsChildren,l_mcbist_target, TARGETING::TYPE_MCS);

            ATTR_VDDR_ID_type l_vddr_id = l_mcbist_target->getAttr<ATTR_VDDR_ID>();
            if(l_domainIdGroups.find(l_vddr_id) == l_domainIdGroups.end())
            {
                std::pair<ATTR_VDDR_ID_type, TARGETING::TargetHandleList> tuple(l_vddr_id, l_mcsChildren);
                l_domainIdGroups.insert(tuple);
            }
            else
            {
                l_domainIdGroups[l_vddr_id].insert(l_domainIdGroups[l_vddr_id].end(), l_mcsChildren.begin(), l_mcsChildren.end());
            }
        }

        for (auto & l_tuple : l_domainIdGroups)
        {
            std::vector<fapi2::Target<fapi2::TARGET_TYPE_MCS>> l_fapi_mcs_targs;
            for(const auto & l_mcs_target : l_tuple.second)
            {
                // Create a FAPI target representing the MCS
                const fapi2::Target <fapi2::TARGET_TYPE_MCS> l_fapi_mcs_target
                (l_mcs_target);
                l_fapi_mcs_targs.push_back(l_fapi_mcs_target);
            }
            // Call the mss_eff_config_thermal HWP
            TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                    "p9_mss_eff_config_thermal HWP. ");
            FAPI_INVOKE_HWP(l_err, p9_mss_eff_config_thermal,l_fapi_mcs_targs);

            if (l_err)
            {
                TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                        "ERROR 0x%.8X:  p9_mss_eff_config_thermal HWP ",
                        l_err->reasonCode());

                // Ensure istep error created and has same plid as this error
                l_StepError.addErrorDetails(l_err);
                errlCommit(l_err, ISTEP_COMP_ID);
            }
            else
            {
                TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                        "SUCCESS : p9_mss_eff_config_thermal HWP");
            }
        }
    }
#ifdef CONFIG_AXONE
    else if(l_procModel == TARGETING::MODEL_AXONE)
    {
        if(l_fapi_ocmb_targets.size() > 0)
        {
            TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                      "call exp_mss_eff_config_thermal HWP on %d OCMB_CHIP targets",
                      l_fapi_ocmb_targets.size());

            FAPI_INVOKE_HWP(l_err, exp_mss_eff_config_thermal, l_fapi_ocmb_targets);

            if (l_err)
            {
                TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                          "ERROR 0x%.8X:  exp_mss_eff_config_thermal HWP",
                          l_err->reasonCode());

                // Ensure istep error created and has same plid as this error
                l_err->collectTrace(EEPROM_COMP_NAME);
                l_err->collectTrace(I2C_COMP_NAME);
                l_StepError.addErrorDetails(l_err);
                errlCommit(l_err, ISTEP_COMP_ID);
            }
            else
            {
                TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                          "SUCCESS :  exp_mss_eff_config_thermal HWP");
            }
        }
        else
        {
            TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
                      "No OCMB_CHIP targets found, skipping exp_mss_eff_config_thermal HWP");
        }
    }
#endif


    if (!l_StepError.isNull())
    {
        break;
    }

    // Stack the memory on each chip
    l_err = call_mss_eff_grouping(l_StepError);

    if (l_err)
    {
        // Ensure istep error created and has same plid as this error
        l_StepError.addErrorDetails( l_err );
        errlCommit( l_err, ISTEP_COMP_ID);
    }

#ifndef CONFIG_FSP_BUILD
    if(!l_StepError.isNull())
    {
        break;
    }

    const char* l_smfMemAmtStr = nullptr;
    l_err = NVRAM::nvramRead(NVRAM::SMF_MEM_AMT_KEY, l_smfMemAmtStr);
    if(l_err)
    {
        TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, INFO_MRK"NVRAM read failed. Will not attempt to distribute any SMF memory.");
        // Do not propagate the error - we don't care if NVRAM read fails
        delete l_err;
        l_err = nullptr;
        break;
    }

    // l_smfMemAmtStr will be nullptr if the SMF_MEM_AMT_KEY doesn't exist
    if(l_smfMemAmtStr)
    {
        uint64_t l_smfMemAmt = strtoul(l_smfMemAmtStr, nullptr, 16);
        TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, INFO_MRK"Distributing 0x%.16llx SMF memory among the procs on the system", l_smfMemAmt);
        l_err = SECUREBOOT::SMF::distributeSmfMem(l_smfMemAmt);
        if(l_err)
        {
            // Do not propagate or break on error - distributeSmfMem will
            // not return unrecoverable errors.
            errlCommit(l_err, ISTEP_COMP_ID);
        }
    }
    else
    {
        TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, INFO_MRK"SMF_MEM_AMT_KEY was not found in NVRAM; no SMF memory was distributed.");
    }

#endif

    } while (0);

    #if (defined CONFIG_SECUREBOOT && ! defined CONFIG_AXONE)
    if(memdLoaded)
    {
        l_err = unloadSecureSection(PNOR::MEMD);
        if (l_err)
        {
            TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
                ERR_MRK "Failed in call to unloadSecureSection for section "
                "PNOR:MEMD");

            // Create istep error and link it to PLID of original error
            l_StepError.addErrorDetails(l_err);
            errlCommit(l_err, ISTEP_COMP_ID);
        }
        else
        {
            memdLoaded = false;
        }
    }
    #endif

    TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_eff_config exit" );
    return l_StepError.getErrorHandle();
}
};   // end namespace
OpenPOWER on IntegriCloud