summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_init.C
blob: 7be25d6568022d7ff36d12bbe1b633b97a7abdb9 (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_init.C $            */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2013,2014              */
/*                                                                        */
/* 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                                                     */
// $Id: p8_pm_init.C,v 1.26 2014/05/02 12:25:37 stillgs Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pm_init.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//------------------------------------------------------------------------------
// *! OWNER NAME: Ralf Maier         Email: ralf.maier@de.ibm.com
// *! BACKUP NAME: Greg Still        Email: stillgs@us.ibm.com
// *!
/// \file p8_pm_init.C
/// \brief Calls each PM unit initialization procedures with the control
///         parameter to process the respective phase:
///             config: use Platform Attributes to create an effective
///                     configuration using relevant Feature Attributes
///             init:   use the Feature attributes to initialize the hardware
///             reset:  call the "p8_pm_prep_reset" procedure to invoke a
///                     reset of the hardware to allow for reinitialization
// *!
// *! Procedure Prereq:
// *!   o System clocks are running
// *!
// *| buildfapiprcd -C p8_pm_utils.C p8_pm_init.C
//------------------------------------------------------------------------------
///
/// \version -------------------------------------------------------------------
/// \version 1.0 stillgs 2012/03/06 Initial Version
/// \version -------------------------------------------------------------------
///
/// \verbatim
///
/// High-level procedure flow:
///     - call p8_pm_prep_for_reset to prepare and perform getting the PM function
///         able to be be (re)initialized
///
///     - call pm_list() to process the individual units in turn
///     - call p8_pcbs_init.C *chiptarget, mode (PM_CONFIG, PM_INIT, PM_RESET)
///     - evaluate RC
///
///     - call p8_pmc_init.C *chiptarget, mode (PM_CONFIG, PM_INIT, PM_RESET)
///     - evaluate RC
///
///     - call p8_poreslw_init.C *chiptarget, mode (PM_CONFIG, PM_INIT, PM_RESET)
///     - evaluate RC
///
///     - call p8_poregpe_init.C *chiptarget, mode (PM_CONFIG, PM_INIT, PM_RESET)
///     - evaluate RC
///
///     - call p8_oha_init.C *chiptarget, mode (PM_CONFIG, PM_INIT, PM_RESET)
///     - evaluate RC
///
///     - call p8_pba_init.C *chiptarget, mode (PM_CONFIG, PM_INIT, PM_RESET)
///     - evaluate RC
///
///     - call p8_occ_sram_init.C *chiptarget,mode (PM_CONFIG, PM_INIT, PM_RESET)
///     - evaluate RC
///
///     - call p8_ocb_init .C *chiptarget, mode (PM_CONFIG, PM_INIT, PM_RESET)
///     - evaluate RC
///
///     - call p8_pss_init .C *chiptarget, mode (PM_CONFIG, PM_INIT, PM_RESET)
///     - evaluate RC
///
///  \endverbatim
///
// ----------------------------------------------------------------------
// Includes
// ----------------------------------------------------------------------

#include "p8_pm.H"
#include "p8_pm_utils.H"
#include "p8_pm_init.H"
#include "p8_pm_prep_for_reset.H"

extern "C" {

using namespace fapi;

// ----------------------------------------------------------------------
// Constant definitions
// ----------------------------------------------------------------------

// ----------------------------------------------------------------------
// Global variables
// ----------------------------------------------------------------------

// ----------------------------------------------------------------------
// Function prototypes
// ----------------------------------------------------------------------

fapi::ReturnCode 
pm_list(const Target& i_target, const Target& i_target2, uint32_t i_mode);

fapi::ReturnCode
clear_occ_special_wakeups (const fapi::Target &i_target);

  
// ----------------------------------------------------------------------
// p8_pm_init
// ----------------------------------------------------------------------

fapi::ReturnCode
p8_pm_init(const fapi::Target &i_target1 ,const fapi::Target &i_target2 , uint32_t mode)
{

    fapi::ReturnCode    rc;
    uint32_t            int_mode;

    do
    {

        int_mode = PM_RESET;
        FAPI_EXEC_HWP(rc, p8_pm_prep_for_reset, i_target1, i_target2, int_mode);
        if (rc)
        {
          FAPI_ERR("ERROR: p8_pm_init detected failed p8_pm_prep_for_reset result");
          break;
        }

        int_mode = PM_CONFIG;
        rc = pm_list(i_target1, i_target2, int_mode);
        if (rc)
        {
            FAPI_ERR("ERROR: p8_pm_list PM_CONFIG detected failed ");
            break;
        }

        int_mode = PM_INIT;      
        rc = pm_list(i_target1, i_target2, int_mode);
        if (rc)
        {
            FAPI_ERR("ERROR: p8_pm_list PM_INIT detected failed ");
            break;
        }

    } while(0);

    return rc;
}

// ----------------------------------------------------------------------
// ocb_channel_reset - Reset each of the OCB channels on the passed target
// ----------------------------------------------------------------------

fapi::ReturnCode
ocb_channel_reset(const Target& i_target, uint32_t i_mode)
{
    fapi::ReturnCode rc;
    
    do
    {
        FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, i_mode, OCB_CHAN0,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL   );
        if (rc)
        {
            FAPI_ERR("ERROR: p8_p8_pm_init detected failed OCB result on channel 0");
            break;
        }

        FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, i_mode, OCB_CHAN1,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL   );
        if (rc)
        {
            FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 1");
            break;
        }

        FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, i_mode, OCB_CHAN2,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL   );
        if (rc)
        {
            FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 2");
            break;
        }

        FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, i_mode,OCB_CHAN3,OCB_TYPE_NULL, 0x10000000, 1 , OCB_Q_OUFLOW_EN , OCB_Q_ITPTYPE_NOTFULL   );
        if (rc)
        {
            FAPI_ERR("ERROR: p8_pm_init detected failed OCB result on channel 3");
            break;
        }
    } while(0);
    return rc;
}

// ----------------------------------------------------------------------
// ocb_channel_init - Initialize the OCB channels as TGMT expects them --- 
// ----------------------------------------------------------------------

fapi::ReturnCode
ocb_channel_init(const Target& i_target)
{
    fapi::ReturnCode rc;
    
    do
    {
        FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, PM_SETUP_PIB, OCB_CHAN0, OCB_TYPE_LINSTR, 0, 0, OCB_Q_OUFLOW_EN, OCB_Q_ITPTYPE_NULL );
        if (rc)
        {
            FAPI_ERR("ERROR: ocb_channel_init detected a failed p8_ocb_init on channel 0");
            break;
        }

        FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, PM_SETUP_PIB, OCB_CHAN1, OCB_TYPE_PUSHQ, 0, 0, OCB_Q_OUFLOW_EN, OCB_Q_ITPTYPE_NULL );
        if (rc)
        {
            FAPI_ERR("ERROR: ocb_channel_init detected a failed p8_ocb_init on channel 1");
            break;
        }

        FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, PM_SETUP_PIB, OCB_CHAN2, OCB_TYPE_LIN, 0, 0, OCB_Q_OUFLOW_NULL, OCB_Q_ITPTYPE_NULL );
        if (rc)
        {
            FAPI_ERR("ERROR: ocb_channel_init detected a failed p8_ocb_init on channel 2");
            break;
        }

        FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, PM_SETUP_PIB, OCB_CHAN3, OCB_TYPE_LINSTR, 0, 0, OCB_Q_OUFLOW_EN, OCB_Q_ITPTYPE_NULL );
        if (rc)
        {
            FAPI_ERR("ERROR: ocb_channel_init detected a failed p8_ocb_init on channel 3");
            break;
        }
    } while(0);
    return rc;        
    
}

// ----------------------------------------------------------------------
// pm_list - process the underlying routines in the prescribed order
// ----------------------------------------------------------------------

fapi::ReturnCode
pm_list(const Target& i_target, const Target& i_target2, uint32_t i_mode)
{

    fapi::ReturnCode    rc;
    ecmdDataBufferBase  data(64);
    uint32_t            effective_mode = 0;
    const char *        PM_MODE_NAME_VAR; // Defines storage for PM_MODE_NAME

    std::vector<fapi::Target>      l_exChiplets;

    FAPI_INF("p8_pm_list start in mode %s", PM_MODE_NAME(i_mode));


    do
    {
        if (i_mode == PM_RESET_SOFT || i_mode == PM_RESET)
        {
            effective_mode = PM_RESET;
            FAPI_DBG("A Reset mode is detected.  Setting effective reset for non-PMC procedures to PM_RESET (mode %x)",
                            effective_mode);
        }
        else
        {
             effective_mode = i_mode;
        }


        //  ******************************************************************
        //  PCBS_PM
        //  ******************************************************************

        FAPI_INF("Executing: p8_pcbs_init.C in mode %s", PM_MODE_NAME(effective_mode));

        if ( i_target.getType() != TARGET_TYPE_NONE )
        {
            FAPI_EXEC_HWP(rc, p8_pcbs_init, i_target, effective_mode);
            if (rc)
            {
              FAPI_ERR("ERROR: p8_pm_init detected failed PCBS_PM result");
              break;
            }
        }


        if ( i_target2.getType() != TARGET_TYPE_NONE )
        {
            FAPI_EXEC_HWP(rc, p8_pcbs_init, i_target2, effective_mode);
            if (rc)
            {
                FAPI_ERR("ERROR: p8_pm_init detected failed PCBS_PM result");
                break;
            }
        }
        //  ******************************************************************
        //  PMC
        //  ******************************************************************

        FAPI_INF("Executing: p8_pmc_init in mode %s", PM_MODE_NAME(i_mode));

        FAPI_EXEC_HWP(rc, p8_pmc_init, i_target, i_target2, i_mode);
        if (rc)
        {
            FAPI_ERR("ERROR: p8_pm_init detected failed PMC result");
            break;
        }

        //  ******************************************************************
        //  PORE Sleep/Winkle engine
        //  ******************************************************************

        // Run SLW for hard reset and hard init and any config. So as to not
        // touch the hardware, skip for soft reset and soft init.
        // if (!(mode == PM_INIT_SOFT || mode == PM_RESET_SOFT ))
//         {
//             FAPI_INF("Executing: p8_poreslw_init in mode %x", mode);
//             if ( i_target.getType() != TARGET_TYPE_NONE )
//             {
//                 FAPI_EXEC_HWP(rc, p8_poreslw_init, i_target, mode);
//                 if (rc)
//                 {
//                     FAPI_ERR("ERROR: p8_pm_init detected failed PORE SLW result");
//                     break;
//                 }
//             }
// 
//             if ( i_target2.getType() != TARGET_TYPE_NONE )
//             {
//                 FAPI_EXEC_HWP(rc, p8_poreslw_init, i_target2, mode);
//                 if (rc)
//                 {
//                     FAPI_ERR("ERROR: p8_pm_init detected failed PORE SLW result");
//                     break;
//                 }
//             }
//         }
//         else
//         {
//             FAPI_INF("Skipping p8_poreslw_init for mode %x - either soft init or soft reset", mode);
//         }
        //  ******************************************************************
        //  PORE General Purpose Engines
        //  ******************************************************************

        FAPI_INF("Executing: p8_poregpe_init in mode %x", effective_mode);

        if ( i_target.getType() != TARGET_TYPE_NONE )
        {
            FAPI_EXEC_HWP(rc, p8_poregpe_init, i_target, effective_mode , GPEALL);
            if (rc)
            {
                FAPI_ERR("ERROR: p8_pm_init detected failed PORE GPE result");
                break;
            }
        }

        if ( i_target2.getType() != TARGET_TYPE_NONE )
        {
            FAPI_EXEC_HWP(rc, p8_poregpe_init, i_target2, effective_mode , GPEALL);
            if (rc)
            {
                FAPI_ERR("ERROR: p8_pm_init detected failed PORE GPE result");
                break;
            }
        }
        //  ******************************************************************
        //  OHA
        //  ******************************************************************

        // FAPI_INF("Executing: p8_oha_init in mode %s", PM_MODE_NAME(effective_mode));
        //          
        // if ( i_target.getType() != TARGET_TYPE_NONE )
        // {
        //     FAPI_EXEC_HWP(rc, p8_oha_init, i_target, effective_mode);
        //     if (rc)
        //     {
        //         FAPI_ERR("ERROR: p8_pm_init detected failed OHA result");
        //         break;
        //     }
        // }
        //
        // if ( i_target2.getType() != TARGET_TYPE_NONE )
        // {
        //     FAPI_EXEC_HWP(rc, p8_oha_init, i_target2, effective_mode);
        //     if (rc)
        //     {
        //         FAPI_ERR("ERROR: p8_pm_init detected failed OHA result");
        //         break;
        //     }
        // }

        //  ******************************************************************
        //  OCC-SRAM
        //  ******************************************************************


        FAPI_INF("Executing: p8_occ_sram_init in mode %s", PM_MODE_NAME(effective_mode));

        if ( i_target.getType() != TARGET_TYPE_NONE )
        {
            FAPI_EXEC_HWP(rc, p8_occ_sram_init, i_target, effective_mode );
            if (rc)
            {
                FAPI_ERR("ERROR: p8_pm_init detected failed OCC-SRAM result");
                break;
            }
        }

        if ( i_target2.getType() != TARGET_TYPE_NONE )
        {
            FAPI_EXEC_HWP(rc, p8_occ_sram_init, i_target2, effective_mode );
            if (rc)
            {
                FAPI_ERR("ERROR: p8_pm_init detected failed OCC-SRAM result");
             break;
            }
        }

        //  ******************************************************************
        //  OCB
        //  ******************************************************************

        FAPI_INF("Executing: p8_ocb_init in mode %s", PM_MODE_NAME(effective_mode));
        if ( i_target.getType() != TARGET_TYPE_NONE )
        {
            if (effective_mode == PM_RESET)
            {
                rc = ocb_channel_reset(i_target, effective_mode);
                if (rc)
                {
                    FAPI_ERR("ERROR: p8_pm_init detected ocb_channel_reset error");
                    break;
                }
            }
            else if (effective_mode == PM_INIT)
            {
                rc = ocb_channel_init(i_target);
                if (rc)
                {
                    FAPI_ERR("ERROR: p8_pm_init detected ocb_channel_init error");
                    break;
                }                       
            }
        }

        if ( i_target2.getType() != TARGET_TYPE_NONE )
        {
            if (effective_mode == PM_RESET)
            {
                rc = ocb_channel_reset(i_target2, effective_mode);
                if (rc)
                {
                    FAPI_ERR("ERROR: p8_pm_init detected ocb_channel_reset error");
                    break;
                }
            }
            else if (effective_mode == PM_INIT)
            {
                rc = ocb_channel_init(i_target2);
                if (rc)
                {
                    FAPI_ERR("ERROR: p8_pm_init detected ocb_channel_init error");
                    break;
                }                       
            }
        }


        //  ******************************************************************
        //  PSS
        //  ******************************************************************

        FAPI_INF("Executing:p8_pss_init in effective_mode %s", PM_MODE_NAME(effective_mode));

        if ( i_target.getType() != TARGET_TYPE_NONE )
        {

            FAPI_EXEC_HWP(rc, p8_pss_init, i_target, effective_mode );
            if (rc)
            {
                FAPI_ERR("ERROR: p8_pm_init detected failed PSS result");
                break;
            }
        }

        if ( i_target2.getType() != TARGET_TYPE_NONE )
        {
            FAPI_EXEC_HWP(rc, p8_pss_init, i_target2, effective_mode );
            if (rc)
            {
                FAPI_ERR("ERROR: p8_pm_init detected failed PSS result");
                break;
            }
        }

        //  ******************************************************************
        //  PBA
        //  ******************************************************************

        FAPI_INF("Executing: p8_pba_init  in effective_mode %s", PM_MODE_NAME(effective_mode));
        if ( i_target.getType() != TARGET_TYPE_NONE )
        {
            FAPI_EXEC_HWP(rc, p8_pba_init, i_target, effective_mode );
            if (rc)
            {
                FAPI_ERR("ERROR: p8_pm_init detected failed PBA result");
                break;
            }
        }

        if ( i_target2.getType() != TARGET_TYPE_NONE )
        {
            FAPI_EXEC_HWP(rc, p8_pba_init, i_target2, effective_mode );
            if (rc)
            {
                FAPI_ERR("ERROR: p8_pm_init detected failed PBA result");
                break;
            }
        }

        if (effective_mode == PM_INIT)
        {
            //  ******************************************************************
            //  FIRINIT
            //  ******************************************************************


            FAPI_INF("Executing:p8_pm_firinit in effective_mode %s", PM_MODE_NAME(i_mode));

            if ( i_target.getType() != TARGET_TYPE_NONE )
            {

                FAPI_EXEC_HWP(rc, p8_pm_firinit, i_target , i_mode );
                if (rc)
                {
                    FAPI_ERR("ERROR: p8_pm_firinit detected failed  result");
                    break;
                }
            }

            if ( i_target2.getType() != TARGET_TYPE_NONE )
            {

                FAPI_EXEC_HWP(rc, p8_pm_firinit, i_target2 , i_mode );
                if (rc)
                {
                    FAPI_ERR("ERROR: p8_pm_firinit detected failed  result");
                    break;
                }
            }                                   

            //  ******************************************************************
            //  CPU_SPECIAL_WAKEUP switch off
            //  ******************************************************************

            if ( i_target.getType() != TARGET_TYPE_NONE )
            {
                rc = clear_occ_special_wakeups (i_target);
                if (!rc.ok())
                {
                    break;
                }
            } 

            if ( i_target2.getType() != TARGET_TYPE_NONE )
            {
                rc = clear_occ_special_wakeups (i_target2);
                if (!rc.ok())
                {
                    break;
                }                  
            } 
                        
        } // PM_INIT special stuff
        
        //  Check for xstops and recoverables
        rc = p8_pm_glob_fir_trace (i_target, "end of p8_pm_init_list");
        if (!rc.ok()) 
        {
            break;
        }  

    } while(0);

    FAPI_INF("p8_pm_list end in mode %s", PM_MODE_NAME(i_mode));
    return rc;

}

/**
 * clear_occ_special_wakeups - clears OCC special wake-up on all configured EXs
 *
 * @param[in] i_target   Chip target w
 *
 * @retval ECMD_SUCCESS
 * @retval ERROR defined in xml
 */
fapi::ReturnCode
clear_occ_special_wakeups (const fapi::Target &i_target)
{
    fapi::ReturnCode                rc;
    uint32_t                        e_rc = 0; 
    uint64_t                        SP_WKUP_REG_ADDRS;
    ecmdDataBufferBase              data(64);   
    std::vector<fapi::Target>       l_exChiplets;
    uint8_t                         l_ex_number = 0;    
    
    do
    {   
             
        rc = fapiGetChildChiplets (  i_target,
                          TARGET_TYPE_EX_CHIPLET,
                          l_exChiplets,
                          TARGET_STATE_FUNCTIONAL);
        if (rc)
        {
          FAPI_ERR("Error from fapiGetChildChiplets!");
          break;
        }

        FAPI_DBG("\tChiplet vector size  => %u ", l_exChiplets.size());

        // Iterate through the returned chiplets
        for (uint8_t j=0; j < l_exChiplets.size(); j++)
        {
            // Build the SCOM address
            rc = FAPI_ATTR_GET( ATTR_CHIP_UNIT_POS, 
                                &l_exChiplets[j], 
                                l_ex_number);
            if (rc)
            {
                FAPI_ERR("Error from ATTR_GET for chip position!");
                break;
            }
            FAPI_DBG("Clearing OCC special wakeup on ex chiplet %d ", 
                                l_ex_number);
                        
            e_rc |= data.flushTo0();
            E_RC_CHECK(e_rc, rc);
            
            SP_WKUP_REG_ADDRS = PM_SPECIAL_WKUP_OCC_0x100F010C + 
                                (l_ex_number  * 0x01000000) ;
            
            PUTSCOM(rc, i_target, SP_WKUP_REG_ADDRS, data);
            
        }  // chiplet loop
        if (!rc.ok())
        {
            break;
        }
    } while(0);
    return rc;
}


} //end extern C

OpenPOWER on IntegriCloud