Skip to content

Commit 1ca209e

Browse files
sannerddcrowell77
authored andcommitted
Honor STOP Gated bit when checking access states
Change-Id: I08d2b377414f0f0491a731efee02359f6cefc27b Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40920 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Gregory S. Still <stillgs@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/40924 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> 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 acda24e commit 1ca209e

File tree

1 file changed

+47
-42
lines changed

1 file changed

+47
-42
lines changed

src/import/chips/p9/procedures/hwp/pm/p9_query_cache_access_state.C

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const uint32_t eq_clk_l2_pos[] = {8, 9};
6060
const uint32_t eq_clk_l3_pos[] = {6, 7};
6161
const uint32_t SSH_REG_STOP_LEVEL = 8;
6262
const uint32_t SSH_REG_STOP_LEVEL_LEN = 4;
63+
const uint32_t SSH_REG_STOP_GATED = 0;
6364

6465
// ----------------------------------------------------------------------
6566
// Procedure Function
@@ -115,57 +116,61 @@ p9_query_cache_access_state(
115116
o_l3_is_scomable = 1;
116117
o_l3_is_scannable = 1;
117118

118-
// STOP8 - Half Quad Deep Sleep
119-
// VSU, ISU are powered off
120-
// IFU, LSU are powered off
121-
// PC, Core EPS are powered off
122-
// L20-EX0 is clocked off if both cores are >= 8
123-
// L20-EX1 is clocked off if both cores are >= 8
124-
if (l_quadStopLevel >= 8)
119+
//Looking at the stop states is only valid if quad is stop gated -- else it is fully running
120+
if (l_qsshsrc.getBit(SSH_REG_STOP_GATED))
125121
{
126-
o_l2_is_scomable = 0;
127-
}
122+
// STOP8 - Half Quad Deep Sleep
123+
// VSU, ISU are powered off
124+
// IFU, LSU are powered off
125+
// PC, Core EPS are powered off
126+
// L20-EX0 is clocked off if both cores are >= 8
127+
// L20-EX1 is clocked off if both cores are >= 8
128+
if (l_quadStopLevel >= 8)
129+
{
130+
o_l2_is_scomable = 0;
131+
}
128132

129-
// STOP9 - Fast Winkle (lab use only)
130-
// Both cores and cache are clocked off
131-
if (l_quadStopLevel >= 9)
132-
{
133-
o_l3_is_scomable = 0;
134-
}
133+
// STOP9 - Fast Winkle (lab use only)
134+
// Both cores and cache are clocked off
135+
if (l_quadStopLevel >= 9)
136+
{
137+
o_l3_is_scomable = 0;
138+
}
135139

136-
// STOP11 - Deep Winkle
137-
// Both cores and cache are powered off
138-
if (l_quadStopLevel >= 11)
139-
{
140-
o_l2_is_scannable = 0;
141-
o_l3_is_scannable = 0;
142-
}
143-
else
144-
{
145-
//Read clock status to confirm stop state history is accurate
146-
//If we trust the stop state history, this could be removed to save on code size
147-
//Compare Hardware status vs stop state status. If there is a mismatch the HW value overrides the stop state
140+
// STOP11 - Deep Winkle
141+
// Both cores and cache are powered off
142+
if (l_quadStopLevel >= 11)
143+
{
144+
o_l2_is_scannable = 0;
145+
o_l3_is_scannable = 0;
146+
}
147+
else
148+
{
149+
//Read clock status to confirm stop state history is accurate
150+
//If we trust the stop state history, this could be removed to save on code size
151+
//Compare Hardware status vs stop state status. If there is a mismatch the HW value overrides the stop state
148152

149-
FAPI_TRY(fapi2::getScom(i_target, EQ_CLOCK_STAT_SL, l_data64), "Error reading data from EQ_CLOCK_STAT_SL");
153+
FAPI_TRY(fapi2::getScom(i_target, EQ_CLOCK_STAT_SL, l_data64), "Error reading data from EQ_CLOCK_STAT_SL");
150154

151-
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, i_target, l_chpltNumber),
152-
"Error: Failed to get the position of the EX:0x%08X", i_target);
153-
l_exPos = l_chpltNumber % 2;
155+
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, i_target, l_chpltNumber),
156+
"Error: Failed to get the position of the EX:0x%08X", i_target);
157+
l_exPos = l_chpltNumber % 2;
154158

155-
l_is_scomable = !l_data64.getBit(eq_clk_l2_pos[l_exPos]);
159+
l_is_scomable = !l_data64.getBit(eq_clk_l2_pos[l_exPos]);
156160

157-
if (o_l2_is_scomable != l_is_scomable)
158-
{
159-
FAPI_INF("Clock status didn't match stop state, overriding is_scomable status");
160-
o_l2_is_scomable = l_is_scomable;
161-
}
161+
if (o_l2_is_scomable != l_is_scomable)
162+
{
163+
FAPI_INF("Clock status didn't match stop state, overriding is_scomable status");
164+
o_l2_is_scomable = l_is_scomable;
165+
}
162166

163-
l_is_scomable = !l_data64.getBit(eq_clk_l3_pos[l_exPos]);
167+
l_is_scomable = !l_data64.getBit(eq_clk_l3_pos[l_exPos]);
164168

165-
if (o_l3_is_scomable != l_is_scomable)
166-
{
167-
FAPI_INF("Clock status didn't match stop state, overriding is_scomable status");
168-
o_l3_is_scomable = l_is_scomable;
169+
if (o_l3_is_scomable != l_is_scomable)
170+
{
171+
FAPI_INF("Clock status didn't match stop state, overriding is_scomable status");
172+
o_l3_is_scomable = l_is_scomable;
173+
}
169174
}
170175
}
171176

0 commit comments

Comments
 (0)