Skip to content

Commit a742bd5

Browse files
cmolsendcrowell77
authored andcommitted
xip_cust: Replacing rc.isRC() w/(uint32_t)rc for WIN32 compatibility.
Change-Id: I399ea1211233a1167a0a4a95dc8bf056571ad8d5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40319 Reviewed-by: Michael C. Sgro <mcs793@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Richard J. Knight <rjknight@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41269 Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
1 parent 16c3d0b commit a742bd5

File tree

1 file changed

+31
-63
lines changed

1 file changed

+31
-63
lines changed

src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C

Lines changed: 31 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,16 @@
2323
/* */
2424
/* IBM_PROLOG_END_TAG */
2525
#ifdef WIN32
26-
#include "win32_stdint.h"
27-
#include "endian.h"
28-
#include "win_sim_fapi.h"
29-
#include "p9_xip_customize.H"
30-
#include "p9_xip_image.h"
31-
#include "p9_ring_identification.H"
32-
#include "p9_tor.H"
33-
#include "p9_scan_compression.H"
34-
#include "p9_infrastruct_help.H"
35-
#include "p9_ringId.H"
36-
37-
using namespace fapi2;
26+
#include "win32_stdint.h"
27+
#include "endian.h"
28+
#include "win_sim_fapi.h"
3829
#else
30+
#include <p9_get_mvpd_ring.H>
31+
#endif
32+
3933
#include <p9_xip_customize.H>
4034
#include <p9_xip_image.h>
4135
#include <p9_ring_identification.H>
42-
#include <p9_get_mvpd_ring.H>
4336
#include <p9_tor.H>
4437
#include <p9_scan_compression.H>
4538
#include <p9_infrastruct_help.H>
@@ -94,6 +87,8 @@ typedef struct
9487

9588
using namespace fapi2;
9689

90+
#ifndef WIN32
91+
9792
#define MBOX_ATTR_WRITE(ID,TARGET,IMAGE) \
9893
{ \
9994
fapi2::ID##_Type ID##_attrVal; \
@@ -522,7 +517,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
522517
break;
523518
} // End switch(sysPhase)
524519
}
525-
else if (l_fapiRc.isRC(RC_MVPD_RING_NOT_FOUND))
520+
else if ((uint32_t)l_fapiRc == RC_MVPD_RING_NOT_FOUND)
526521
{
527522
// Update for ring not found in mvpd
528523
io_ringStatusInMvpd = RING_NOT_FOUND;
@@ -547,7 +542,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
547542
// getMvpdRing failed due to insufficient ring buffer space.
548543
// Assumption here is that getMvpdRing returns required buffer size
549544
// in l_vpdRingSize (and which it does!).
550-
FAPI_ASSERT( !l_fapiRc.isRC(RC_MVPD_RING_BUFFER_TOO_SMALL),
545+
FAPI_ASSERT( (uint32_t)l_fapiRc != RC_MVPD_RING_BUFFER_TOO_SMALL,
551546
fapi2::XIPC_MVPD_RING_SIZE_TOO_BIG().
552547
set_CHIP_TARGET(i_procTarget).
553548
set_RING_ID(i_ring.ringId).
@@ -559,7 +554,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
559554
l_vpdRingSize, i_vpdRingSize );
560555

561556
// getMvpdRing failed due to invalid record data magic word.
562-
FAPI_ASSERT( !l_fapiRc.isRC(RC_MVPD_INVALID_RS4_HEADER),
557+
FAPI_ASSERT( (uint32_t)l_fapiRc != RC_MVPD_INVALID_RS4_HEADER,
563558
fapi2::XIPC_MVPD_INVALID_RECORD_DATA().
564559
set_CHIP_TARGET(i_procTarget).
565560
set_RING_ID(i_ring.ringId).
@@ -569,19 +564,8 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
569564
// getMvpdRing failed for some other reason aside from above handled cases.
570565
if (l_fapiRc != fapi2::FAPI2_RC_SUCCESS)
571566
{
572-
#ifdef WIN32
573-
574-
if (l_fapiRc == SKIP_RING_ID)
575-
{
576-
l_fapiRc = fapi2::FAPI2_RC_SUCCESS;
577-
FAPI_DBG("N/A MVPD ring for chiptype: ringId=0x%02X, chipletId=0x%02X ",
578-
i_ring.ringId, l_chipletId);
579-
}
580-
581-
#else
582567
FAPI_ERR("_fetch_and_insert_vpd_ring(): getMvpdRing failed "
583568
" w/rc=0x%08X", (uint64_t)l_fapiRc);
584-
#endif
585569
fapi2::current_err = l_fapiRc;
586570
}
587571
}
@@ -711,9 +695,9 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
711695
l_bImgOutOfSpace,
712696
io_bootCoreMask );
713697

714-
if ( (l_fapiRc.isRC(RC_XIPC_IMAGE_WOULD_OVERFLOW)) ||
715-
(!(l_fapiRc.isRC(RC_MVPD_RING_REDUNDANT_DATA)) &&
716-
(l_fapiRc != fapi2::FAPI2_RC_SUCCESS)) )
698+
if ( (uint32_t)l_fapiRc == RC_XIPC_IMAGE_WOULD_OVERFLOW ||
699+
( (uint32_t)l_fapiRc != RC_MVPD_RING_REDUNDANT_DATA &&
700+
l_fapiRc != fapi2::FAPI2_RC_SUCCESS ) )
717701
{
718702
fapi2::current_err = l_fapiRc;
719703
FAPI_DBG("_fetch_and_insert_vpd_rings() for common rings w/rc:0x%.8x",
@@ -821,7 +805,7 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
821805
(0x00F00000 >> (eq * CORES_PER_QUAD));
822806
}
823807

824-
if (l_fapiRc.isRC(RC_XIPC_IMAGE_WOULD_OVERFLOW))
808+
if ((uint32_t)l_fapiRc == RC_XIPC_IMAGE_WOULD_OVERFLOW)
825809
{
826810
// Capture EQ number when image ran out-of-space while appending ring
827811
l_eqNumWhenOutOfSpace = eq;
@@ -830,8 +814,8 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
830814
l_instanceVpdRing.chipletUnderProcess = EQ_CHIPLET;
831815
l_instanceVpdRing.chipletNumUnderProcess = eq;
832816
}
833-
else if ( !(l_fapiRc.isRC(RC_MVPD_RING_REDUNDANT_DATA)) &&
834-
( l_fapiRc != fapi2::FAPI2_RC_SUCCESS) )
817+
else if ( (uint32_t)l_fapiRc != RC_MVPD_RING_REDUNDANT_DATA &&
818+
l_fapiRc != fapi2::FAPI2_RC_SUCCESS )
835819
{
836820
fapi2::current_err = l_fapiRc;
837821
FAPI_DBG("_fetch_and_insert_vpd_rings() for EQ rings w/rc:0x%.8x", (uint64_t)fapi2::current_err );
@@ -926,7 +910,7 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
926910
(0x00C00000 >> (ex * (CORES_PER_QUAD / 2)));
927911
}
928912

929-
if (l_fapiRc.isRC(RC_XIPC_IMAGE_WOULD_OVERFLOW))
913+
if ((uint32_t)l_fapiRc == RC_XIPC_IMAGE_WOULD_OVERFLOW)
930914
{
931915
// Capture EQ number when image ran out-of-space while appending ring
932916
l_eqNumWhenOutOfSpace = eq;
@@ -936,8 +920,8 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
936920
l_instanceVpdRing.exReprRingNum = inst;
937921
l_instanceVpdRing.chipletNumUnderProcess = ex;
938922
}
939-
else if ( !(l_fapiRc.isRC(RC_MVPD_RING_REDUNDANT_DATA)) &&
940-
(l_fapiRc != fapi2::FAPI2_RC_SUCCESS) )
923+
else if ( (uint32_t)l_fapiRc != RC_MVPD_RING_REDUNDANT_DATA &&
924+
l_fapiRc != fapi2::FAPI2_RC_SUCCESS )
941925
{
942926
fapi2::current_err = l_fapiRc;
943927
FAPI_DBG("_fetch_and_insert_vpd_rings() for EX rings w/rc:0x%.8x", (uint64_t)fapi2::current_err );
@@ -1007,7 +991,7 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
1007991
(0x00800000 >> ec);
1008992
}
1009993

1010-
if (l_fapiRc.isRC(RC_XIPC_IMAGE_WOULD_OVERFLOW))
994+
if ((uint32_t)l_fapiRc == RC_XIPC_IMAGE_WOULD_OVERFLOW)
1011995
{
1012996
// Capture EQ number when image ran out-of-space while appending ring
1013997
l_eqNumWhenOutOfSpace = eq;
@@ -1016,17 +1000,17 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
10161000
l_instanceVpdRing.chipletUnderProcess = EC_CHIPLET;
10171001
l_instanceVpdRing.chipletNumUnderProcess = ec;
10181002
}
1019-
else if ( !(l_fapiRc.isRC(RC_MVPD_RING_REDUNDANT_DATA)) &&
1020-
(l_fapiRc != fapi2::FAPI2_RC_SUCCESS) )
1003+
else if ( (uint32_t)l_fapiRc != RC_MVPD_RING_REDUNDANT_DATA &&
1004+
l_fapiRc != fapi2::FAPI2_RC_SUCCESS )
10211005
{
10221006
fapi2::current_err = l_fapiRc;
10231007
FAPI_DBG("_fetch_and_insert_vpd_rings() for EC rings w/rc:0x%.8x", (uint64_t)fapi2::current_err );
10241008
goto fapi_try_exit;
10251009
}
1026-
else if ( ((l_fapiRc == fapi2::FAPI2_RC_SUCCESS) ||
1027-
(l_fapiRc.isRC(RC_MVPD_RING_REDUNDANT_DATA)) ||
1028-
(l_fapiRc.isRC(RC_MVPD_RING_NOT_FOUND))) &&
1029-
(l_bImgOutOfSpace == false) )
1010+
else if ( ( l_fapiRc == fapi2::FAPI2_RC_SUCCESS ||
1011+
(uint32_t)l_fapiRc == RC_MVPD_RING_REDUNDANT_DATA ||
1012+
(uint32_t)l_fapiRc == RC_MVPD_RING_NOT_FOUND ) &&
1013+
l_bImgOutOfSpace == false )
10301014
{
10311015
FAPI_DBG("(INS) io_ringSectionSize = %d", io_ringSectionSize);
10321016
l_activeCoreMask |= (uint32_t)( 1 << ((NUM_OF_CORES - 1) - ec) );
@@ -1603,7 +1587,7 @@ ReturnCode p9_xip_customize (
16031587
// Adjust the local size of MAX_SEEPROM_IMAGE_SIZE to accommodate enlarged image for Cronus
16041588
l_fapiRc2 = FAPI_ATTR_GET(fapi2::ATTR_MAX_SBE_SEEPROM_SIZE, FAPI_SYSTEM, attrMaxSbeSeepromSize);
16051589

1606-
FAPI_ASSERT( l_fapiRc2.isRC(fapi2::FAPI2_RC_SUCCESS),
1590+
FAPI_ASSERT( l_fapiRc2 == fapi2::FAPI2_RC_SUCCESS,
16071591
fapi2::XIPC_FAPI_ATTR_SVC_FAIL().
16081592
set_CHIP_TARGET(i_procTarget).
16091593
set_OCCURRENCE(2),
@@ -1745,9 +1729,7 @@ ReturnCode p9_xip_customize (
17451729
if (l_fapiRc)
17461730
{
17471731

1748-
#ifndef WIN32
1749-
1750-
if (l_fapiRc.isRC(RC_XIPC_IMAGE_WOULD_OVERFLOW))
1732+
if ((uint32_t)l_fapiRc == RC_XIPC_IMAGE_WOULD_OVERFLOW)
17511733
{
17521734
FAPI_INF("p9_xip_customize(): Image is full. Ran out of space appending VPD rings"
17531735
" to the .rings section");
@@ -1758,7 +1740,7 @@ ReturnCode p9_xip_customize (
17581740

17591741
l_fapiRc2 = FAPI_ATTR_GET(fapi2::ATTR_SBE_IMAGE_MINIMUM_VALID_ECS, FAPI_SYSTEM, attrMinReqdEcs);
17601742

1761-
FAPI_ASSERT( l_fapiRc2.isRC(fapi2::FAPI2_RC_SUCCESS),
1743+
FAPI_ASSERT( l_fapiRc2 == fapi2::FAPI2_RC_SUCCESS,
17621744
fapi2::XIPC_IMAGE_WOULD_OVERFLOW_ADDL_INFO().
17631745
set_CHIP_TARGET(i_procTarget).
17641746
set_REQUESTED_BOOT_CORE_MASK(l_requestedBootCoreMask).
@@ -1790,22 +1772,8 @@ ReturnCode p9_xip_customize (
17901772
"Image buffer would overflow before reaching the minimum required"
17911773
" number of EC boot cores" );
17921774

1793-
//@TODO: Enable following lines in RTC158106 (Vpd column insertion order)
1794-
#if 0
1795-
FAPI_INF( "Image is full and with sufficient boot cores:\n"
1796-
" Final bootCoreMask: 0x%08X\n"
1797-
" Number of boot cores: %d\n"
1798-
" Min req'd boot cores: %d",
1799-
io_bootCoreMask, l_actualEcCount, attrMinReqdEcs );
1800-
1801-
l_fapiRc = fapi2::FAPI2_RC_SUCCESS;
1802-
#endif
1803-
18041775
}
18051776

1806-
#else
1807-
FAPI_INF("fetch_and_insert_vpd_rings returned error rc=0x%08x", l_fapiRc);
1808-
#endif
18091777
fapi2::current_err = l_fapiRc;
18101778
goto fapi_try_exit;
18111779

@@ -1922,7 +1890,7 @@ ReturnCode p9_xip_customize (
19221890
// Extract the DD level to enable retrieval of correct CME/SGPE ring blocks
19231891
l_fapiRc = FAPI_ATTR_GET_PRIVILEGED(fapi2::ATTR_EC, i_procTarget, attrDdLevel);
19241892

1925-
FAPI_ASSERT( l_fapiRc.isRC(fapi2::FAPI2_RC_SUCCESS),
1893+
FAPI_ASSERT( l_fapiRc == fapi2::FAPI2_RC_SUCCESS,
19261894
fapi2::XIPC_FAPI_ATTR_SVC_FAIL().
19271895
set_CHIP_TARGET(i_procTarget).
19281896
set_OCCURRENCE(1),

0 commit comments

Comments
 (0)