EDAC/amd64: Support more than two Unified Memory Controllers
authorYazen Ghannam <yazen.ghannam@amd.com>
Thu, 28 Feb 2019 15:36:10 +0000 (15:36 +0000)
committerBorislav Petkov <bp@suse.de>
Tue, 26 Mar 2019 23:13:25 +0000 (00:13 +0100)
commitbdcee7747f5c490297665af0e1e0fbeb4368804d
treefd79cb8c3a582226be66d7b1cbf74e3afef6b326
parent4d30d2bc3c23e63c2608bc5b03b0960490d5b740
EDAC/amd64: Support more than two Unified Memory Controllers

The first few models of Family 17h all had 2 Unified Memory Controllers
per Die, so this was treated as a fixed value. However, future systems
may have more Unified Memory Controllers per Die.

Related to this, the channel number and base address of a Unified Memory
Controller were found by matching on fixed, known values. However,
current and future systems follow this pattern for the channel number
and base address of a Unified Memory Controller: 0xYXXXXX, where Y is
the channel number. So matching on hardcoded values is not necessary.

Set the number of Unified Memory Controllers at driver init time based
on the family/model. Also, update the functions that find the channel
number and base address of a Unified Memory Controller to support more
than two.

 [ bp: Move num_umcs into the .c file and simplify comment. ]

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Kim Phillips <kim.phillips@amd.com>
Cc: James Morse <james.morse@arm.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: https://lkml.kernel.org/r/20190228153558.127292-3-Yazen.Ghannam@amd.com
drivers/edac/amd64_edac.c
drivers/edac/amd64_edac.h