summaryrefslogtreecommitdiffstats
path: root/drivers/edac/i82860_edac.c
diff options
context:
space:
mode:
authorYazen Ghannam <yazen.ghannam@amd.com>2019-08-21 23:59:59 +0000
committerBorislav Petkov <bp@suse.de>2019-08-23 07:23:53 +0200
commite53a3b267fb0a79db9ca1f1e08b97889b22013e6 (patch)
tree8850719f48919cd2826f39f92846cfba6a13c9a1 /drivers/edac/i82860_edac.c
parent353a1fcb8f9e5857c0fb720b9e57a86c1fb7c17e (diff)
downloadlinux-e53a3b267fb0a79db9ca1f1e08b97889b22013e6.tar.bz2
EDAC/amd64: Find Chip Select memory size using Address Mask
Chip Select memory size reporting on AMD Family 17h was recently fixed in order to account for interleaving. However, the current method is not robust. The Chip Select Address Mask can be used to find the memory size. There are a couple of cases. 1) For single-rank and dual-rank non-interleaved, use the address mask plus 1 as the size. 2) For dual-rank interleaved, do #1 but "de-interleave" the address mask first. Always "de-interleave" the address mask in order to simplify the code flow. Bit mask manipulation is necessary to check for interleaving, so just go ahead and do the de-interleaving. In the non-interleaved case, the original and de-interleaved address masks will be the same. To de-interleave the mask, count the number of zero bits in the middle of the mask and swap them with the most significant bits. For example, Original=0xFFFF9FE, De-interleaved=0x3FFFFFE Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org> Cc: James Morse <james.morse@arm.com> Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: Tony Luck <tony.luck@intel.com> Link: https://lkml.kernel.org/r/20190821235938.118710-5-Yazen.Ghannam@amd.com
Diffstat (limited to 'drivers/edac/i82860_edac.c')
0 files changed, 0 insertions, 0 deletions