Skip to content

Commit

Permalink
P9_l3err_extract HWP -fix bugs
Browse files Browse the repository at this point in the history
May 3rd
-- Add both cache read address and hashed real address (45:56)
to the output.

May 2nd
--Move real address translation into p9_l3err_extract.C
instead of in the wrapper.

April 27th,
-- ">>" bug fixed.
--Change Dataout output from binary to hex.
--Add the second busy bit poll action after writing the
PRD Purge Engine Command Register.

April 26th,
--fixed the translation method  from edram read address
to real_addr (45:56).

April 25th,
--Wrap the p9_l3err_linedelete procedure into the HWP.
------------------
1) When error is not found for an EX, the procedure will
continue for next EXes
2) Add the SUE detection which is only CE and UE previously
3) When commandline is wrong, error alerts
4) address name changed from "real address" to "Cache Read
   Address"

Change-Id: Ia3d499a580e45f3384188a9113699fd962424aa2
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39494
Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: ALEXANDER M. TAFT <amtaft@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40877
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Chen Qian authored and dcrowell77 committed May 25, 2017
1 parent 071e5f0 commit e912642
Show file tree
Hide file tree
Showing 5 changed files with 403 additions and 15 deletions.
98 changes: 87 additions & 11 deletions src/import/chips/p9/procedures/hwp/cache/p9_l3err_extract.C
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ extern "C"
// HWP entry point
//------------------------------------------------------------------------------
fapi2::ReturnCode p9_l3err_extract(const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_target,
p9_l3err_extract_err_data& o_err_data)
p9_l3err_extract_err_data& o_err_data,
bool& o_error_found)
{

fapi2::buffer<uint64_t> l_l3eDRAM_rd_err_stat_data0;
Expand All @@ -96,6 +97,13 @@ extern "C"
uint8_t member_select = 0;
uint8_t read_select = 0;
bool ce_ue = true;
bool sue = false;

uint16_t real_address45_52 = 0;
uint16_t real_address53_54 = 0;
uint16_t real_address55 = 0;
uint16_t real_address56 = 0;
uint16_t real_address45_56 = 0;


// mark function entry
Expand Down Expand Up @@ -124,11 +132,16 @@ extern "C"


FAPI_DBG("err_stat_val = %x", err_stat_val);
// no CE or UE error found by Scom registers
FAPI_ASSERT(err_stat_val,
fapi2::P9_L3ERR_EXTRACT_NO_CEUE_FOUND()
.set_TARGET(i_target),
"No CE or UE captured.");

o_error_found = err_stat_val;

// Dont's panic if no CE or UE error found by Scom registers
if (!err_stat_val)
{
FAPI_DBG ("No error is found!");
return fapi2::current_err;
}


// syndrome value
l_l3eDRAM_rd_err_stat_data0.extractToRight<EX_ED_RD_ERR_STAT_REG0_L3_1ST_BEAT_SYNDROME, EX_ED_RD_ERR_STAT_REG0_L3_1ST_BEAT_SYNDROME_LEN>
Expand All @@ -145,12 +158,37 @@ extern "C"
FAPI_DBG("Checking second beat for syndrome data.");
syndrome = err_2nd_beat_syndrome;
ce_ue = !(err_stat_2nd_beat_UE);

if (ce_ue == false)
{
if (err_2nd_beat_syndrome == 0xFE)
{
sue = true;
}
else
{
sue = false;
}
}

}
else
{
syndrome = err_1st_beat_syndrome;
err_in_first_beat = 1;
ce_ue = !(err_stat_1st_beat_UE);

if (ce_ue == false)
{
if (err_1st_beat_syndrome == 0xFE)
{
sue = true;
}
else
{
sue = false;
}
}
}

// if could not find syndrome
Expand Down Expand Up @@ -244,29 +282,67 @@ extern "C"
member = err_stat_bank;
}

// Translate cache read address to real address first
// The EDRAM read-address is made up of edram_ra(0:9) & edram_ca(0:2) & edram_rs.
// Edram_ra(0:9) are taken from hashed address(56, 55, 45:52)
// Edram_ca(0:2) are taken from hashed address(53:54)& memberGroup (member 0-9 vs.10-19)
// Edram_rs is taken from address(57)
real_address45_52 = err_stat_ra & (0x0FF0);
real_address53_54 = err_stat_ra & (0x000C);
real_address55 = (err_stat_ra & (0x1000)) >> 11;
real_address56 = (err_stat_ra & (0x2000)) >> 13;
real_address45_56 = real_address45_52 | real_address53_54 | real_address55 | real_address56;

//print out error location information
if( ce_ue )
{
FAPI_DBG("CE Location Information");
}
else
{
FAPI_DBG("UE Location Information");
if(!sue)
{

FAPI_DBG("UE Location Information");
}
else
{
FAPI_DBG("SUE Location Information");
}

}

FAPI_DBG("\tDW = %u", dw);
FAPI_DBG("\tBank = %u", err_stat_bank);
FAPI_DBG("\tMember = %u", member);
FAPI_DBG("\tAddress = 0x%X", err_stat_ra);
FAPI_DBG("\tDataout = %u", dataout);
FAPI_DBG("\tCache Read Address = 0x%X", err_stat_ra);
FAPI_DBG("\tHashed Real Address (45:56) = 0x%X", real_address45_56);
FAPI_DBG("\tDataout = 0x%X", dataout);

// output error data
o_err_data.ce_ue = ce_ue ? L3ERR_CE : L3ERR_UE;
//o_err_data.ce_ue = ce_ue ? L3ERR_CE : L3ERR_UE;
if (ce_ue)
{
o_err_data.ce_ue = L3ERR_CE;
}
else
{
if(!sue)
{
o_err_data.ce_ue = L3ERR_UE;
}
else
{
o_err_data.ce_ue = L3ERR_SUE;
}
}

o_err_data.member = member;
o_err_data.dw = dw;
o_err_data.bank = err_stat_bank;
o_err_data.dataout = dataout;
o_err_data.address = err_stat_ra;
o_err_data.hashed_real_address_45_56 = real_address45_56;
o_err_data.cache_read_address = err_stat_ra;

fapi_try_exit:
// mark HWP exit
Expand Down
13 changes: 9 additions & 4 deletions src/import/chips/p9/procedures/hwp/cache/p9_l3err_extract.H
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enum p9_l3err_extract_err_type
{
L3ERR_CE,
L3ERR_UE,
L3ERR_SUE,
L3ERR_CE_UE
};

Expand All @@ -61,12 +62,14 @@ struct p9_l3err_extract_err_data
uint8_t dw; //3-bit
uint8_t bank; //3-bit
uint8_t dataout; //decimal 0-144, 8-bit
uint16_t address;//13-bit
uint16_t hashed_real_address_45_56;//12-bit
uint16_t cache_read_address;//14-bit
};

// function pointer typedef definition for HWP call support
typedef fapi2::ReturnCode (*p9_l3err_extract_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_target,
p9_l3err_extract_err_data& o_err_data);
typedef fapi2::ReturnCode (*p9_l3err_extract_FP_t)( const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_target,
p9_l3err_extract_err_data& o_err_data,
bool& o_err_found);

extern "C"
{
Expand All @@ -80,9 +83,11 @@ extern "C"
// parameters: i_ex_chiplet => chiplet target used for callouts
// i_err_type => type of error that is to be extracted (CE,UE,both)
// o_err_data => failing location information for CE or UE
// o_err_found => error is found

fapi2::ReturnCode p9_l3err_extract(const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_target,
p9_l3err_extract_err_data& o_err_data);
p9_l3err_extract_err_data& o_err_data,
bool& o_error_found);

} // extern "C"

Expand Down

0 comments on commit e912642

Please sign in to comment.