Skip to content

Commit 1e01ced

Browse files
Chen Qiandcrowell77
authored andcommitted
P9 L2/L3 cache error extraction
Change-Id: Iaf44268029dfd4f87a799112004317f07152e302 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29945 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40871 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>
1 parent 3798680 commit 1e01ced

File tree

9 files changed

+1289
-0
lines changed

9 files changed

+1289
-0
lines changed

src/import/chips/p9/procedures/hwp/cache/p9_l2err_extract.C

Lines changed: 534 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/* IBM_PROLOG_BEGIN_TAG */
2+
/* This is an automatically generated prolog. */
3+
/* */
4+
/* $Source: src/import/chips/p9/procedures/hwp/cache/p9_l2err_extract.H $ */
5+
/* */
6+
/* OpenPOWER HostBoot Project */
7+
/* */
8+
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
9+
/* [+] International Business Machines Corp. */
10+
/* */
11+
/* */
12+
/* Licensed under the Apache License, Version 2.0 (the "License"); */
13+
/* you may not use this file except in compliance with the License. */
14+
/* You may obtain a copy of the License at */
15+
/* */
16+
/* http://www.apache.org/licenses/LICENSE-2.0 */
17+
/* */
18+
/* Unless required by applicable law or agreed to in writing, software */
19+
/* distributed under the License is distributed on an "AS IS" BASIS, */
20+
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
21+
/* implied. See the License for the specific language governing */
22+
/* permissions and limitations under the License. */
23+
/* */
24+
/* IBM_PROLOG_END_TAG */
25+
//------------------------------------------------------------------------------
26+
// *|
27+
// *! TITLE : p9_l2err_extract.H
28+
// *! DESCRIPTION : Parse and extract error information from L2 trace array (FAPI)
29+
// *!
30+
// *! OWNER NAME : Chen Qian Email: qianqc@cn.ibm.com
31+
// *!
32+
// *! ADDITIONAL COMMENTS :
33+
// *!
34+
// *! Parses the contents of the L2_T0 trace array for L2 error data.
35+
// *! Will look for occurances of an L2 CE or UE and capture associated data.
36+
// *!
37+
// *! Assume that the L2 trace array is set up to capture CEs/UEs, and
38+
// *! that it is NOT running in banked mode. Also trace must have been set to
39+
// *! stop on error.
40+
// *|
41+
// *! NOTE: Trace entries must be provided within data buffer from oldest->youngest entry.
42+
// *!
43+
// *! NOTE: This procedure only looks for the oldest error in the trace array. Other
44+
// *! errors can be present in the first or second beat of data, or for datawords
45+
// *! greater than the one with the first error.
46+
//------------------------------------------------------------------------------
47+
48+
#ifndef _P9_L2ERR_EXTRACT_H_
49+
#define _P9_L2ERR_EXTRACT_H_
50+
51+
//------------------------------------------------------------------------------
52+
// Includes
53+
//------------------------------------------------------------------------------
54+
#include <fapi2.H>
55+
56+
//------------------------------------------------------------------------------
57+
// Structure definitions
58+
//------------------------------------------------------------------------------
59+
60+
// enum used to denote what type of error occured or which we want to find
61+
enum p9_l2err_extract_err_type
62+
{
63+
L2ERR_CE,
64+
L2ERR_UE,
65+
L2ERR_CE_UE
66+
};
67+
68+
// structure to document control/data registers for each supported trace array
69+
struct p9_l2err_extract_err_data
70+
{
71+
p9_l2err_extract_err_type ce_ue;
72+
uint8_t member; //3-bit
73+
uint8_t dw; //3-bit
74+
uint8_t macro; //2-bit d0-d2
75+
uint8_t bank; //1-bit
76+
uint8_t ow_select;//1-bit
77+
uint8_t bitline; //decimal 0-99
78+
bool is_top_sa; //top or bottom subarray
79+
bool is_left_sa; //left or right subarray
80+
uint16_t address;//10 bits addr48_57
81+
};
82+
83+
// function pointer typedef definition for HWP call support
84+
typedef fapi2::ReturnCode
85+
(*p9_l2err_extract_FP_t) (const fapi2::Target<fapi2::TARGET_TYPE_EX>&,
86+
const fapi2::variable_buffer&,
87+
p9_l2err_extract_err_type,
88+
p9_l2err_extract_err_data&);
89+
90+
extern "C"
91+
{
92+
93+
//------------------------------------------------------------------------------
94+
// Function prototype
95+
//------------------------------------------------------------------------------
96+
97+
// function: FAPI2 p9_l2err_extract HWP entry point
98+
// Parse and extract L2 error information from provided
99+
// L2_T0 trace array that has been stopped on an L2 CE or UE.
100+
// parameters: i_target => chiplet target for callouts
101+
// i_ta_data => ecmdDataBufferBase that contains the trace data
102+
// i_err_type => type of error that is to be extracted (CE,UE,both)
103+
// o_err_data => failing location information for CE or UE
104+
105+
fapi2::ReturnCode p9_l2err_extract(const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_target,
106+
const fapi2::variable_buffer& i_ta_data,
107+
p9_l2err_extract_err_type i_err_type,
108+
p9_l2err_extract_err_data& o_err_data);
109+
110+
} // extern "C"
111+
112+
#endif // _P9_L2ERR_EXTRACT_H_
113+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# IBM_PROLOG_BEGIN_TAG
2+
# This is an automatically generated prolog.
3+
#
4+
# $Source: src/import/chips/p9/procedures/hwp/cache/p9_l2err_extract.mk $
5+
#
6+
# OpenPOWER HostBoot Project
7+
#
8+
# Contributors Listed Below - COPYRIGHT 2015,2017
9+
# [+] International Business Machines Corp.
10+
#
11+
#
12+
# Licensed under the Apache License, Version 2.0 (the "License");
13+
# you may not use this file except in compliance with the License.
14+
# You may obtain a copy of the License at
15+
#
16+
# http://www.apache.org/licenses/LICENSE-2.0
17+
#
18+
# Unless required by applicable law or agreed to in writing, software
19+
# distributed under the License is distributed on an "AS IS" BASIS,
20+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
21+
# implied. See the License for the specific language governing
22+
# permissions and limitations under the License.
23+
#
24+
# IBM_PROLOG_END_TAG
25+
PROCEDURE=p9_l2err_extract
26+
$(call BUILD_PROCEDURE)
27+
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/* IBM_PROLOG_BEGIN_TAG */
2+
/* This is an automatically generated prolog. */
3+
/* */
4+
/* $Source: src/import/chips/p9/procedures/hwp/cache/p9_l2err_linedelete.C $ */
5+
/* */
6+
/* OpenPOWER HostBoot Project */
7+
/* */
8+
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
9+
/* [+] International Business Machines Corp. */
10+
/* */
11+
/* */
12+
/* Licensed under the Apache License, Version 2.0 (the "License"); */
13+
/* you may not use this file except in compliance with the License. */
14+
/* You may obtain a copy of the License at */
15+
/* */
16+
/* http://www.apache.org/licenses/LICENSE-2.0 */
17+
/* */
18+
/* Unless required by applicable law or agreed to in writing, software */
19+
/* distributed under the License is distributed on an "AS IS" BASIS, */
20+
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
21+
/* implied. See the License for the specific language governing */
22+
/* permissions and limitations under the License. */
23+
/* */
24+
/* IBM_PROLOG_END_TAG */
25+
//------------------------------------------------------------------------------
26+
// *|
27+
// *! TITLE : p9_l2err_linedelete.C
28+
// *! DESCRIPTION : Delete the L2 error cache line according to the error extraction information.
29+
// *!
30+
// *! OWNER NAME : Chen Qian Email: qianqc@cn.ibm.com
31+
// *!
32+
// *! ADDITIONAL COMMENTS :
33+
// *! See header file for additional comments.
34+
//------------------------------------------------------------------------------
35+
36+
37+
//------------------------------------------------------------------------------
38+
// Includes
39+
//------------------------------------------------------------------------------
40+
#include <p9_l2err_linedelete.H>
41+
#include <p9_quad_scom_addresses.H>
42+
#include <p9_quad_scom_addresses_fld.H>
43+
//------------------------------------------------------------------------------
44+
// Constant definitions
45+
//------------------------------------------------------------------------------
46+
47+
extern "C"
48+
{
49+
50+
//------------------------------------------------------------------------------
51+
// Function definitions
52+
//------------------------------------------------------------------------------
53+
54+
//------------------------------------------------------------------------------
55+
// HWP entry point
56+
//------------------------------------------------------------------------------
57+
fapi2::ReturnCode p9_l2err_linedelete(const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_target,
58+
const p9_l2err_extract_err_data& i_err_data)
59+
{
60+
61+
62+
uint8_t member = 0;
63+
uint8_t bank = 0;
64+
uint16_t cgc = 0;
65+
fapi2::buffer<uint64_t> l_l2_l2cerrs_prd_purge_cmd_reg;
66+
67+
// mark function entry
68+
FAPI_DBG("Entering p9_l2err_linedelete...");
69+
70+
// +---------------------------+
71+
// | L2 Line Delete Scom |
72+
// +---------------------------+
73+
// |Bit(s)| Data |
74+
// +------+--------------------+
75+
// | 0 | Trigger |
76+
// +------+--------------------+
77+
// | 1:4 | Purge type (LD=0x2)|
78+
// +------+--------------------+
79+
// | 5:16 | Don't care |
80+
// +------+--------------------+
81+
// |17:19 | Member |
82+
// +------+--------------------+
83+
// |20:27 | CGC addr 48:55 |
84+
// +------+--------------------+
85+
// | 28 | Bank |
86+
// +------+--------------------+
87+
// |29:30 | Don't care |
88+
// +------+--------------------+
89+
90+
member = i_err_data.member;
91+
bank = i_err_data.bank;
92+
cgc = i_err_data.address;
93+
94+
// Write member, cgc address and bank into PRD Purge Engine Command Register
95+
// SCOM Addr: 0x000000001001080E
96+
// bit 0 is the trigger, the act of writing this bit to 1 sets off the line delete
97+
// bits 1:4 is ttype 0b0010 = line delete
98+
// bits 17:19 is the member
99+
// bits 20:27 is the cgc address
100+
// bit 28 is the bank
101+
FAPI_TRY(fapi2::getScom(i_target, EX_PRD_PURGE_CMD_REG, l_l2_l2cerrs_prd_purge_cmd_reg),
102+
"Error from getScom (l_l2_l2cerrs_prd_purge_cmd_reg)");
103+
FAPI_DBG("l_l2_l2cerrs_prd_purge_cmd_reg_data: %#lx", l_l2_l2cerrs_prd_purge_cmd_reg);
104+
105+
l_l2_l2cerrs_prd_purge_cmd_reg.insertFromRight<EX_PRD_PURGE_CMD_REG_MEM, EX_PRD_PURGE_CMD_REG_MEM_LEN>(member);
106+
l_l2_l2cerrs_prd_purge_cmd_reg.insertFromRight<EX_PRD_PURGE_CMD_REG_CGC, EX_PRD_PURGE_CMD_REG_CGC_LEN>(cgc);
107+
l_l2_l2cerrs_prd_purge_cmd_reg.insertFromRight<EX_PRD_PURGE_CMD_REG_BANK, 1>(bank);
108+
109+
FAPI_DBG("l_l2_l2cerrs_prd_purge_cmd_reg_data: %#lx", l_l2_l2cerrs_prd_purge_cmd_reg);
110+
FAPI_TRY(fapi2::putScom(i_target, EX_PRD_PURGE_CMD_REG, l_l2_l2cerrs_prd_purge_cmd_reg),
111+
"Error from putScom (l_l2_l2cerrs_prd_purge_cmd_reg)");
112+
113+
// mark HWP exit
114+
fapi_try_exit:
115+
FAPI_INF("Exiting p9_l2err_linedelete...");
116+
return fapi2::current_err;
117+
} // p9_l2err_extract
118+
119+
} // extern "C
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/* IBM_PROLOG_BEGIN_TAG */
2+
/* This is an automatically generated prolog. */
3+
/* */
4+
/* $Source: src/import/chips/p9/procedures/hwp/cache/p9_l2err_linedelete.H $ */
5+
/* */
6+
/* OpenPOWER HostBoot Project */
7+
/* */
8+
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
9+
/* [+] International Business Machines Corp. */
10+
/* */
11+
/* */
12+
/* Licensed under the Apache License, Version 2.0 (the "License"); */
13+
/* you may not use this file except in compliance with the License. */
14+
/* You may obtain a copy of the License at */
15+
/* */
16+
/* http://www.apache.org/licenses/LICENSE-2.0 */
17+
/* */
18+
/* Unless required by applicable law or agreed to in writing, software */
19+
/* distributed under the License is distributed on an "AS IS" BASIS, */
20+
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
21+
/* implied. See the License for the specific language governing */
22+
/* permissions and limitations under the License. */
23+
/* */
24+
/* IBM_PROLOG_END_TAG */
25+
//------------------------------------------------------------------------------
26+
// *|
27+
// *! TITLE : p9_l2err_linedelete.H
28+
// *! DESCRIPTION : Delete the L2 error cache line according to the error extraction information
29+
// *!
30+
// *! OWNER NAME : Chen Qian Email: qianqc@cn.ibm.com
31+
// *!
32+
// *! ADDITIONAL COMMENTS :
33+
// *!
34+
// *! Write member, cgc address and bank into PRD Purge Engine Command Register
35+
// *! SCOM Addr: 0x000000001001080E
36+
// *! bit 0 is the trigger, the act of writing this bit to 1 sets off the line delete
37+
// *! bits 1:4 is the ttype 0b0010 = line delete
38+
// *! bits 17:19 is the member
39+
// *| bits 20:27 is the cgc address
40+
// *| bit 28 is the bank
41+
// *|
42+
// *! NOTE: The error information is extracted by the HWP p9_l2err_extract.
43+
// *| An output data structure is dumped to this proceder and wrapped
44+
//------------------------------------------------------------------------------
45+
46+
#ifndef _P9_L2ERR_LINEDELETE_H_
47+
#define _P9_L2ERR_LINEDELETE_H_
48+
49+
//------------------------------------------------------------------------------
50+
// Includes
51+
//------------------------------------------------------------------------------
52+
#include <fapi2.H>
53+
#include <p9_l2err_extract.H>
54+
55+
//------------------------------------------------------------------------------
56+
// Structure definitions
57+
//------------------------------------------------------------------------------
58+
59+
// function pointer typedef definition for HWP call support
60+
typedef fapi2::ReturnCode
61+
(*p9_l2err_linedelete_FP_t) (const fapi2::Target<fapi2::TARGET_TYPE_EX>&,
62+
const p9_l2err_extract_err_data& );
63+
64+
extern "C"
65+
{
66+
67+
68+
69+
fapi2::ReturnCode p9_l2err_linedelete(const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_target,
70+
const p9_l2err_extract_err_data& i_err_data);
71+
72+
} // extern "C"
73+
74+
#endif // _P9_L2ERR_LINEDELETE_H_
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# IBM_PROLOG_BEGIN_TAG
2+
# This is an automatically generated prolog.
3+
#
4+
# $Source: src/import/chips/p9/procedures/hwp/cache/p9_l2err_linedelete.mk $
5+
#
6+
# OpenPOWER HostBoot Project
7+
#
8+
# Contributors Listed Below - COPYRIGHT 2015,2017
9+
# [+] International Business Machines Corp.
10+
#
11+
#
12+
# Licensed under the Apache License, Version 2.0 (the "License");
13+
# you may not use this file except in compliance with the License.
14+
# You may obtain a copy of the License at
15+
#
16+
# http://www.apache.org/licenses/LICENSE-2.0
17+
#
18+
# Unless required by applicable law or agreed to in writing, software
19+
# distributed under the License is distributed on an "AS IS" BASIS,
20+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
21+
# implied. See the License for the specific language governing
22+
# permissions and limitations under the License.
23+
#
24+
# IBM_PROLOG_END_TAG
25+
PROCEDURE=p9_l2err_linedelete
26+
$(call BUILD_PROCEDURE)
27+

0 commit comments

Comments
 (0)