23
23
/* */
24
24
/* IBM_PROLOG_END_TAG */
25
25
#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"
38
29
#else
30
+ #include <p9_get_mvpd_ring.H>
31
+ #endif
32
+
39
33
#include <p9_xip_customize.H>
40
34
#include <p9_xip_image.h>
41
35
#include <p9_ring_identification.H>
42
- #include <p9_get_mvpd_ring.H>
43
36
#include <p9_tor.H>
44
37
#include <p9_scan_compression.H>
45
38
#include <p9_infrastruct_help.H>
@@ -94,6 +87,8 @@ typedef struct
94
87
95
88
using namespace fapi2 ;
96
89
90
+ #ifndef WIN32
91
+
97
92
#define MBOX_ATTR_WRITE (ID ,TARGET ,IMAGE ) \
98
93
{ \
99
94
fapi2::ID##_Type ID##_attrVal; \
@@ -522,7 +517,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
522
517
break ;
523
518
} // End switch(sysPhase)
524
519
}
525
- else if (l_fapiRc . isRC ( RC_MVPD_RING_NOT_FOUND ) )
520
+ else if (( uint32_t ) l_fapiRc == RC_MVPD_RING_NOT_FOUND )
526
521
{
527
522
// Update for ring not found in mvpd
528
523
io_ringStatusInMvpd = RING_NOT_FOUND ;
@@ -547,7 +542,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
547
542
// getMvpdRing failed due to insufficient ring buffer space.
548
543
// Assumption here is that getMvpdRing returns required buffer size
549
544
// 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 ,
551
546
fapi2 ::XIPC_MVPD_RING_SIZE_TOO_BIG ().
552
547
set_CHIP_TARGET (i_procTarget ).
553
548
set_RING_ID (i_ring .ringId ).
@@ -559,7 +554,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
559
554
l_vpdRingSize , i_vpdRingSize );
560
555
561
556
// 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 ,
563
558
fapi2 ::XIPC_MVPD_INVALID_RECORD_DATA ().
564
559
set_CHIP_TARGET (i_procTarget ).
565
560
set_RING_ID (i_ring .ringId ).
@@ -569,19 +564,8 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
569
564
// getMvpdRing failed for some other reason aside from above handled cases.
570
565
if (l_fapiRc != fapi2 ::FAPI2_RC_SUCCESS )
571
566
{
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
582
567
FAPI_ERR ("_fetch_and_insert_vpd_ring(): getMvpdRing failed "
583
568
" w/rc=0x%08X" , (uint64_t )l_fapiRc );
584
- #endif
585
569
fapi2 ::current_err = l_fapiRc ;
586
570
}
587
571
}
@@ -711,9 +695,9 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
711
695
l_bImgOutOfSpace ,
712
696
io_bootCoreMask );
713
697
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 ) )
717
701
{
718
702
fapi2 ::current_err = l_fapiRc ;
719
703
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(
821
805
(0x00F00000 >> (eq * CORES_PER_QUAD ));
822
806
}
823
807
824
- if (l_fapiRc . isRC ( RC_XIPC_IMAGE_WOULD_OVERFLOW ) )
808
+ if (( uint32_t ) l_fapiRc == RC_XIPC_IMAGE_WOULD_OVERFLOW )
825
809
{
826
810
// Capture EQ number when image ran out-of-space while appending ring
827
811
l_eqNumWhenOutOfSpace = eq ;
@@ -830,8 +814,8 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
830
814
l_instanceVpdRing .chipletUnderProcess = EQ_CHIPLET ;
831
815
l_instanceVpdRing .chipletNumUnderProcess = eq ;
832
816
}
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 )
835
819
{
836
820
fapi2 ::current_err = l_fapiRc ;
837
821
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(
926
910
(0x00C00000 >> (ex * (CORES_PER_QUAD / 2 )));
927
911
}
928
912
929
- if (l_fapiRc . isRC ( RC_XIPC_IMAGE_WOULD_OVERFLOW ) )
913
+ if (( uint32_t ) l_fapiRc == RC_XIPC_IMAGE_WOULD_OVERFLOW )
930
914
{
931
915
// Capture EQ number when image ran out-of-space while appending ring
932
916
l_eqNumWhenOutOfSpace = eq ;
@@ -936,8 +920,8 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
936
920
l_instanceVpdRing .exReprRingNum = inst ;
937
921
l_instanceVpdRing .chipletNumUnderProcess = ex ;
938
922
}
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 )
941
925
{
942
926
fapi2 ::current_err = l_fapiRc ;
943
927
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(
1007
991
(0x00800000 >> ec );
1008
992
}
1009
993
1010
- if (l_fapiRc . isRC ( RC_XIPC_IMAGE_WOULD_OVERFLOW ) )
994
+ if (( uint32_t ) l_fapiRc == RC_XIPC_IMAGE_WOULD_OVERFLOW )
1011
995
{
1012
996
// Capture EQ number when image ran out-of-space while appending ring
1013
997
l_eqNumWhenOutOfSpace = eq ;
@@ -1016,17 +1000,17 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
1016
1000
l_instanceVpdRing .chipletUnderProcess = EC_CHIPLET ;
1017
1001
l_instanceVpdRing .chipletNumUnderProcess = ec ;
1018
1002
}
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 )
1021
1005
{
1022
1006
fapi2 ::current_err = l_fapiRc ;
1023
1007
FAPI_DBG ("_fetch_and_insert_vpd_rings() for EC rings w/rc:0x%.8x" , (uint64_t )fapi2 ::current_err );
1024
1008
goto fapi_try_exit ;
1025
1009
}
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 )
1030
1014
{
1031
1015
FAPI_DBG ("(INS) io_ringSectionSize = %d" , io_ringSectionSize );
1032
1016
l_activeCoreMask |= (uint32_t )( 1 << ((NUM_OF_CORES - 1 ) - ec ) );
@@ -1603,7 +1587,7 @@ ReturnCode p9_xip_customize (
1603
1587
// Adjust the local size of MAX_SEEPROM_IMAGE_SIZE to accommodate enlarged image for Cronus
1604
1588
l_fapiRc2 = FAPI_ATTR_GET (fapi2 ::ATTR_MAX_SBE_SEEPROM_SIZE , FAPI_SYSTEM , attrMaxSbeSeepromSize );
1605
1589
1606
- FAPI_ASSERT ( l_fapiRc2 . isRC ( fapi2 ::FAPI2_RC_SUCCESS ) ,
1590
+ FAPI_ASSERT ( l_fapiRc2 == fapi2 ::FAPI2_RC_SUCCESS ,
1607
1591
fapi2 ::XIPC_FAPI_ATTR_SVC_FAIL ().
1608
1592
set_CHIP_TARGET (i_procTarget ).
1609
1593
set_OCCURRENCE (2 ),
@@ -1745,9 +1729,7 @@ ReturnCode p9_xip_customize (
1745
1729
if (l_fapiRc )
1746
1730
{
1747
1731
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 )
1751
1733
{
1752
1734
FAPI_INF ("p9_xip_customize(): Image is full. Ran out of space appending VPD rings"
1753
1735
" to the .rings section" );
@@ -1758,7 +1740,7 @@ ReturnCode p9_xip_customize (
1758
1740
1759
1741
l_fapiRc2 = FAPI_ATTR_GET (fapi2 ::ATTR_SBE_IMAGE_MINIMUM_VALID_ECS , FAPI_SYSTEM , attrMinReqdEcs );
1760
1742
1761
- FAPI_ASSERT ( l_fapiRc2 . isRC ( fapi2 ::FAPI2_RC_SUCCESS ) ,
1743
+ FAPI_ASSERT ( l_fapiRc2 == fapi2 ::FAPI2_RC_SUCCESS ,
1762
1744
fapi2 ::XIPC_IMAGE_WOULD_OVERFLOW_ADDL_INFO ().
1763
1745
set_CHIP_TARGET (i_procTarget ).
1764
1746
set_REQUESTED_BOOT_CORE_MASK (l_requestedBootCoreMask ).
@@ -1790,22 +1772,8 @@ ReturnCode p9_xip_customize (
1790
1772
"Image buffer would overflow before reaching the minimum required"
1791
1773
" number of EC boot cores" );
1792
1774
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
-
1804
1775
}
1805
1776
1806
- #else
1807
- FAPI_INF ("fetch_and_insert_vpd_rings returned error rc=0x%08x" , l_fapiRc );
1808
- #endif
1809
1777
fapi2 ::current_err = l_fapiRc ;
1810
1778
goto fapi_try_exit ;
1811
1779
@@ -1922,7 +1890,7 @@ ReturnCode p9_xip_customize (
1922
1890
// Extract the DD level to enable retrieval of correct CME/SGPE ring blocks
1923
1891
l_fapiRc = FAPI_ATTR_GET_PRIVILEGED (fapi2 ::ATTR_EC , i_procTarget , attrDdLevel );
1924
1892
1925
- FAPI_ASSERT ( l_fapiRc . isRC ( fapi2 ::FAPI2_RC_SUCCESS ) ,
1893
+ FAPI_ASSERT ( l_fapiRc == fapi2 ::FAPI2_RC_SUCCESS ,
1926
1894
fapi2 ::XIPC_FAPI_ATTR_SVC_FAIL ().
1927
1895
set_CHIP_TARGET (i_procTarget ).
1928
1896
set_OCCURRENCE (1 ),
0 commit comments