Skip to content

Commit

Permalink
TOR Magic header support
Browse files Browse the repository at this point in the history
HW-Image-Coreq=Yes
SBE-Image-Coreq=No (SBE image is back compatible)

This commit adds an 12-byte header to all TOR ring sections:
- for improved self-containment of TOR ring sections incl
  stand-alone ring sections like .overrides which, currently,
  has no meaningful size info associated with it in the PNOR,
- to support a more data-driven implementation of TOR API,
- to eliminate the current usage of XIP_MAGIC ids to inform the
  TOR APIs which ring section they are dealing with, and
- to improve debugging binary ring sections.

The TOR header expands on the current TorNumDdLevels field in the
HW ring section and is added to all other ring sections as well,
e.g. for the SBE and OVRD ring sections.  Most importantly, the
TOR header adds the TOR magic number which is unique for each
possible TOR ring section. Also, of quite practical importance,
a size field has been added so that the size of a true standalone
section like .overrides can be extracted (since its size in PNOR
is not indicative of its size).

Further, to support the use of ddLevel and chipType in the TOR
header fields, these two data points need to be always supplied
whenever calling ring_apply. Thus, updates have been made to the
ring_apply.mk file as well as the override .pl script.  While
making these changes, we also decided to change the --type arg
to the --bOverrides arg to make the arguments being passed less
confusing in view of the Centaur commit that's coming and its
demands to make codes less data dependent, incl make and script
files which should simply inform the functional intent of the
"user". The user shouldn't presume it knows about which specific
type of ring section needs to be produced.

Further, the DD level block struct has been increased from 8B
to 12B to avoid the unnecessarily complex merging of the
ddLevel and offset into the same 4B field. It's included in
this commit since this is also going to break the lab and
because the required code changes are in the same places
where the code changes needed for the TOR header are.

Further, xip_tool has been updated to support the new TOR
header so that it can be called by supplying a standalone
ring section, such as overrides.bin. Various changes have
been made in xip_tool's dissect section to support overrides
as well.

This code uses many  of the code changes in 33778 except
changes to p9_tor.C|H are at a bare minimum focusing on the
functional changes and keeping any cleanups to a minimum changing
only some variable names associated with the functional changes
for improved readability of the code.

CMVC-Prereq: 1034144
CMVC-Prereq: 1035575
Change-Id: I29ba8905ac55dad5c10878a94fb94468e5580ea0
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35372
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37994
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
cmolsen authored and crgeddes committed Oct 4, 2017
1 parent 4e27f10 commit 976c88b
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 229 deletions.
2 changes: 1 addition & 1 deletion src/build/citest/etc/bbuild
@@ -1,3 +1,3 @@
/esw/fips910/Builds/b0908a_1738.910
/esw/fips910/Builds/b0930a_1740.910


23 changes: 15 additions & 8 deletions src/build/citest/etc/workarounds.postsimsetup
Expand Up @@ -32,22 +32,29 @@
#mkdir -p $sb/simu/data/cec-chip/
#cp $BACKING_BUILD/src/simu/data/cec-chip/base_cec_chip_file $sb/simu/data/cec-chip
#patch -p0 $sb/simu/data/cec-chip/base_cec_chip_file $PROJECT_ROOT/src/build/citest/etc/patches/my_patch_File
#pull in new actions in p9_memory.act RTC 171066
#pull in SBE makefile change for DD2.1
sbex -t 1032604
cd $sb/sbei/sbfw/
mk -a && mk install_all
cd -


#changes needed for Cumulus
#@TODO RTC:178949
echo "Applying SIMICS workaround to support Cumulus"
sbex -t 1031560
sbex -t 1032617
sbex -t 1033442
cd $sb/simu
mk -a

echo "Copying centaur and p9c action files"
sbex -t 1032952
sbex -t 1033805

#pull in href tor
sbex -t 1035576
#pull in hwsv tor
sbex -t 1034144


mkdir $sb/../obj/ppc/hwsv/server/buildhwpfimport/hwpf2/tools/x86_binaries -p
cp /gsa/rchgsa/home/c/r/crgeddes/documents/hbBuild/p9_ipl_build $sb/../obj/ppc/hwsv/server/buildhwpfimport/hwpf2/tools/x86_binaries/





Expand Up @@ -302,7 +302,6 @@ fapi2::ReturnCode get_overlays_ring(
// Get Gptr overlay ring from overlays section into ringBuf2
l_rc = P9_TOR::tor_get_single_ring(
i_overlaysSection,
P9_XIP_MAGIC_SEEPROM,
l_ddLevel,
i_ringId,
P9_TOR::SBE,
Expand Down
7 changes: 0 additions & 7 deletions src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C
Expand Up @@ -2006,7 +2006,6 @@ uint32_t getPpeScanRings( void* const i_pHwImage,
sgpeOvrdRings.getRingName( quadCmnOvrdRingId ) );

rc = tor_get_single_ring( i_pOverride,
P9_XIP_MAGIC_SEEPROM,
i_chipState.getChipLevel(),
quadCmnOvrdRingId,
P9_TOR::SBE,
Expand Down Expand Up @@ -2486,7 +2485,6 @@ fapi2::ReturnCode layoutCmnRingsForCme( Homerlayout_t* i_pHomer,
}

rc = tor_get_single_ring( i_ringData.iv_pRingBuffer,
P9_XIP_MAGIC_CME,
i_chipState.getChipLevel(),
coreCmnRingId,
P9_TOR::CME,
Expand Down Expand Up @@ -2604,7 +2602,6 @@ fapi2::ReturnCode layoutInstRingsForCme( Homerlayout_t* i_pHomer,

tempSize = i_ringData.iv_sizeWorkBuf1;
rc = tor_get_single_ring( i_ringData.iv_pRingBuffer,
P9_XIP_MAGIC_CME,
i_chipState.getChipLevel(),
io_cmeRings.getInstRingId(0),
P9_TOR::CME,
Expand Down Expand Up @@ -2669,7 +2666,6 @@ fapi2::ReturnCode layoutInstRingsForCme( Homerlayout_t* i_pHomer,

tempSize = i_ringData.iv_sizeWorkBuf1;
rc = tor_get_single_ring( i_ringData.iv_pRingBuffer,
P9_XIP_MAGIC_CME,
i_chipState.getChipLevel(),
io_cmeRings.getInstRingId(0),
P9_TOR::CME,
Expand Down Expand Up @@ -2780,7 +2776,6 @@ fapi2::ReturnCode layoutCmeScanOverride( Homerlayout_t* i_pHomer,
cmeOvrdRings.getRingName( coreCmnOvrdRingId ) );

rc = tor_get_single_ring( i_pOverride,
P9_XIP_MAGIC_SEEPROM,
i_chipState.getChipLevel(),
coreCmnOvrdRingId,
P9_TOR::SBE,
Expand Down Expand Up @@ -3132,7 +3127,6 @@ fapi2::ReturnCode layoutCmnRingsForSgpe( Homerlayout_t* i_pHomer,
l_ringVariant = BASE;
}
rc = tor_get_single_ring( i_ringData.iv_pRingBuffer,
P9_XIP_MAGIC_SGPE,
i_chipState.getChipLevel(),
torRingId,
P9_TOR::SGPE,
Expand Down Expand Up @@ -3251,7 +3245,6 @@ fapi2::ReturnCode layoutInstRingsForSgpe( Homerlayout_t* i_pHomer,

quadSpecRingId = io_sgpeRings.getInstRingId( ringIndex );
rc = tor_get_single_ring( i_ringData.iv_pRingBuffer,
P9_XIP_MAGIC_SGPE,
i_chipState.getChipLevel(),
quadSpecRingId,
P9_TOR::SGPE,
Expand Down
23 changes: 20 additions & 3 deletions src/import/chips/p9/utils/imageProcs/p9_ringId.H
Expand Up @@ -68,9 +68,10 @@ typedef enum RingVariant // Base variables
NOT_VALID = 0xff
} RingVariant_t;

#define P9_RINGID_VARIANT_ORDER_SIZE 3
typedef struct
{
uint8_t variant[3];
uint8_t variant[P9_RINGID_VARIANT_ORDER_SIZE];
} RingVariantOrder;


Expand Down Expand Up @@ -244,6 +245,7 @@ const uint8_t INSTANCE_RING_MASK = 0x7F;

namespace PERV
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -289,6 +291,7 @@ static const CHIPLET_DATA g_pervData =

namespace N0
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -318,12 +321,13 @@ static const CHIPLET_DATA g_n0Data =
2, // N0 Chiplet ID is 2.
9, // 9 common rings for N0 Chiplet
3, // 3 instance specific rings for N0 chiplet
3
3 // FIXME: number of variants? doesn't match RingVariants below!
};
};

namespace N1
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -363,6 +367,7 @@ static const CHIPLET_DATA g_n1Data =

namespace N2
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -398,6 +403,7 @@ static const CHIPLET_DATA g_n2Data =

namespace N3
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -434,6 +440,7 @@ static const CHIPLET_DATA g_n3Data =

namespace XB
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -476,6 +483,7 @@ static const CHIPLET_DATA g_xbData =

namespace MC
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -519,6 +527,7 @@ static const CHIPLET_DATA g_mcData =

namespace OB0
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -551,6 +560,7 @@ static const CHIPLET_DATA g_ob0Data =

namespace OB1
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -584,6 +594,7 @@ static const CHIPLET_DATA g_ob1Data =

namespace OB2
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -616,6 +627,7 @@ static const CHIPLET_DATA g_ob2Data =

namespace OB3
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -647,6 +659,7 @@ static const CHIPLET_DATA g_ob3Data =
}; // end of namespace OB2
namespace PCI0
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -676,6 +689,7 @@ static const CHIPLET_DATA g_pci0Data =

namespace PCI1
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -705,6 +719,7 @@ static const CHIPLET_DATA g_pci1Data =

namespace PCI2
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -735,6 +750,7 @@ static const CHIPLET_DATA g_pci2Data =

namespace EQ
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -832,6 +848,7 @@ static const CHIPLET_DATA g_eqData =

namespace EC
{
// FIXME: this struct is nonsense - no one uses these fields (we only need the variant number)
struct RingVariants
{
uint16_t iv_base;
Expand Down Expand Up @@ -868,7 +885,7 @@ static const uint8_t INVALID_RING = 0xFF;
#ifndef __PPE__
struct ringProperties_t
{
uint8_t iv_torOffSet;
uint8_t iv_torOffSet; // FIXME: misnomer
char iv_name[50];
CHIPLET_TYPE iv_type;
};
Expand Down

0 comments on commit 976c88b

Please sign in to comment.