@@ -60,6 +60,7 @@ const uint32_t eq_clk_l2_pos[] = {8, 9};
60
60
const uint32_t eq_clk_l3_pos [] = {6 , 7 };
61
61
const uint32_t SSH_REG_STOP_LEVEL = 8 ;
62
62
const uint32_t SSH_REG_STOP_LEVEL_LEN = 4 ;
63
+ const uint32_t SSH_REG_STOP_GATED = 0 ;
63
64
64
65
// ----------------------------------------------------------------------
65
66
// Procedure Function
@@ -115,57 +116,61 @@ p9_query_cache_access_state(
115
116
o_l3_is_scomable = 1 ;
116
117
o_l3_is_scannable = 1 ;
117
118
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 ))
125
121
{
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
+ }
128
132
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
+ }
135
139
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
148
152
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" );
150
154
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 ;
154
158
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 ]);
156
160
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
+ }
162
166
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 ]);
164
168
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
+ }
169
174
}
170
175
}
171
176
0 commit comments