aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2011-01-13 10:01:13 -0500
committerBorislav Petkov <borislav.petkov@amd.com>2011-03-17 09:46:21 -0400
commit5d4b58e84a382309dfa4dbe19220cd1f78ffc71f (patch)
tree8d608bbe95786145a54eb42706c4b0af066a34f7 /drivers/edac
parente2f79dbdfbf4326fcec50a3c2568476df24b16b6 (diff)
amd64_edac: Fix channel interleave removal
Remove the channel interleave select bit properly. See F2x110[DctSelIntLvAddr] for details. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/amd64_edac.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index f3f4ee909ef5..1cbe9cac6539 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -1373,7 +1373,7 @@ static int f10_match_to_this_node(struct amd64_pvt *pvt, int range,
1373{ 1373{
1374 int cs_found = -EINVAL; 1374 int cs_found = -EINVAL;
1375 u64 chan_addr; 1375 u64 chan_addr;
1376 u32 tmp, dct_sel_base; 1376 u32 dct_sel_base;
1377 u8 channel; 1377 u8 channel;
1378 bool high_range = false; 1378 bool high_range = false;
1379 1379
@@ -1411,19 +1411,27 @@ static int f10_match_to_this_node(struct amd64_pvt *pvt, int range,
1411 chan_addr = ((chan_addr >> (12 + hweight8(intlv_en))) << 12) | 1411 chan_addr = ((chan_addr >> (12 + hweight8(intlv_en))) << 12) |
1412 (chan_addr & 0xfff); 1412 (chan_addr & 0xfff);
1413 1413
1414 /* remove channel interleave and hash */ 1414 /* remove channel interleave */
1415 if (dct_interleave_enabled(pvt) && 1415 if (dct_interleave_enabled(pvt) &&
1416 !dct_high_range_enabled(pvt) && 1416 !dct_high_range_enabled(pvt) &&
1417 !dct_ganging_enabled(pvt)) { 1417 !dct_ganging_enabled(pvt)) {
1418 if (dct_sel_interleave_addr(pvt) != 1) 1418
1419 chan_addr = (chan_addr >> 1) & GENMASK(6, 63); 1419 if (dct_sel_interleave_addr(pvt) != 1) {
1420 else { 1420 if (dct_sel_interleave_addr(pvt) == 0x3)
1421 tmp = chan_addr & 0xFC0; 1421 /* hash 9 */
1422 chan_addr = ((chan_addr & GENMASK(14, 63)) >> 1) | tmp; 1422 chan_addr = ((chan_addr >> 10) << 9) |
1423 } 1423 (chan_addr & 0x1ff);
1424 else
1425 /* A[6] or hash 6 */
1426 chan_addr = ((chan_addr >> 7) << 6) |
1427 (chan_addr & 0x3f);
1428 } else
1429 /* A[12] */
1430 chan_addr = ((chan_addr >> 13) << 12) |
1431 (chan_addr & 0xfff);
1424 } 1432 }
1425 1433
1426 debugf1(" (ChannelAddrLong=0x%llx)\n", chan_addr); 1434 debugf1(" Normalized DCT addr: 0x%llx\n", chan_addr);
1427 1435
1428 cs_found = f10_lookup_addr_in_dct(chan_addr, node_id, channel); 1436 cs_found = f10_lookup_addr_in_dct(chan_addr, node_id, channel);
1429 1437