summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/dmi_training/proc_dmi_scominit/proc_dmi_scominit.C
blob: b55d6cdc0825eb6ac06fa091ccbf3d86423af007 (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/hwpf/hwp/dmi_training/proc_dmi_scominit/proc_dmi_scominit.C $ */
/*                                                                        */
/* IBM CONFIDENTIAL                                                       */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2013                   */
/*                                                                        */
/* p1                                                                     */
/*                                                                        */
/* Object Code Only (OCO) source materials                                */
/* Licensed Internal Code Source Materials                                */
/* IBM HostBoot Licensed Internal Code                                    */
/*                                                                        */
/* The source code for this program is not published or otherwise         */
/* divested of its trade secrets, irrespective of what has been           */
/* deposited with the U.S. Copyright Office.                              */
/*                                                                        */
/* Origin: 30                                                             */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
// $Id: proc_dmi_scominit.C,v 1.7 2013/05/14 15:45:32 jmcgill Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_dmi_scominit.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2012
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//------------------------------------------------------------------------------
// *! TITLE       : proc_dmi_scominit.C
// *! DESCRIPTION : Invoke DMI initfiles (FAPI)
// *!
// *! OWNER NAME  : Mike Jones        Email: mjjones@us.ibm.com
// *! BACKUP NAME : Joe McGill        Email: jmcgill@us.ibm.com
// *!
// *! ADDITIONAL COMMENTS :
// *!
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//  Version		Date		Owner		Description
//------------------------------------------------------------------------------
//    1.7       05/14/13    jmcgill     Address review comments
//    1.6	   	05/01/13	jgrell		Added proc chip target
//    1.5	   	02/06/13	jmcgill		Change passed targets in order to match scominit file updates.
//    1.4	   	02/04/13	thomsen		Fixed informational print to not say Error
//    1.3	   	01/23/13	thomsen		Added separate calls to base & customized scominit files. Removed separate calls to SIM vs. HW scominit files
//    1.2	   	01/10/13	thomsen		Added separate calls to SIM vs. HW scominit files
//   									Added commented-out call to OVERRIDE initfile for system/bus/lane specific inits
//                                      Changed passed targets in order to match scominit file updates.
//                                      CO-REQs required: p8.dmi.vbu.scom.initfile v1.1 and p8.dmi.hw.scom.initfile v1.1
//    1.1       8/11/12     jmcgill		Initial release
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
//  Includes
//------------------------------------------------------------------------------
#include <fapiHwpExecInitFile.H>
#include <proc_dmi_scominit.H>

extern "C" {

//------------------------------------------------------------------------------
// Function definitions
//------------------------------------------------------------------------------

// HWP entry point, comments in header
fapi::ReturnCode proc_dmi_scominit(const fapi::Target & i_target)
{

    fapi::ReturnCode rc;
    fapi::Target i_this_pu_target;
    std::vector<fapi::Target> targets;

    // mark HWP entry
    FAPI_INF("proc_dmi_scominit: Start");

    do
    {
        // Get parent chip target
        rc = fapiGetParentChip(i_target, i_this_pu_target);
        if (!rc.ok())
        {
            FAPI_ERR("proc_dmi_scominit: Error from fapiGetParentChip");
            break;
        }

        // populate targets vector (i_target=chiplet target)
        targets.push_back(i_target);
        targets.push_back(i_this_pu_target);

        // processor MCS chiplet target
        // test target type to confirm correct before calling initfile(s) to execute
        if (i_target.getType() == fapi::TARGET_TYPE_MCS_CHIPLET)
        {
            // Call BASE DMI SCOMINIT
            FAPI_INF("proc_dmi_scominit: fapiHwpExecInitfile executing %s on %s",
                     MCS_DMI_BASE_IF, i_target.toEcmdString());
            FAPI_EXEC_HWP(rc, fapiHwpExecInitFile, targets, MCS_DMI_BASE_IF);
            if (!rc.ok())
            {
                FAPI_ERR("proc_dmi_scominit: Error from fapiHwpExecInitfile executing %s on %s",
                         MCS_DMI_BASE_IF, i_target.toEcmdString());
                break;
            }
            // Call CUSTOMIZED DMI SCOMINIT (system specific)
            FAPI_INF("proc_dmi_scominit: fapiHwpExecInitfile executing %s on %s",
                     MCS_DMI_CUSTOM_IF, i_target.toEcmdString());
            FAPI_EXEC_HWP(rc, fapiHwpExecInitFile, targets, MCS_DMI_CUSTOM_IF);
            if (!rc.ok())
            {
                FAPI_ERR("proc_dmi_scominit: Error from fapiHwpExecInitfile executing %s on %s",
                         MCS_DMI_CUSTOM_IF, i_target.toEcmdString());
                break;
            }
        }
        // unsupported target type
        else
        {
            FAPI_ERR("proc_dmi_scominit: Unsupported target type");
            FAPI_SET_HWP_ERROR(rc, RC_PROC_DMI_SCOMINIT_INVALID_TARGET);
            break;
        }
    } while (0);

    // mark HWP exit
    FAPI_INF("proc_dmi_scominit: End");
    return rc;
}


} // extern "C"
OpenPOWER on IntegriCloud