diff options
author | Aristeu Rozanski <aris@redhat.com> | 2014-06-02 14:15:23 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-06-26 14:46:25 -0400 |
commit | f14d6892e4a6086d48fa77ac8e59003d3f4f8e16 (patch) | |
tree | 2bf0fffa3aa8d86534e86f6eccfd0389e263eb8c /drivers/edac | |
parent | 9e3754461507147ce5bffba5faaea7c182d64667 (diff) |
sb_edac: make node id retrieval per model
Haswell has a different way to retrieve the node id, make so this procedure
can be reimplemented.
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/sb_edac.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 44336cb0a561..3335281982dc 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c | |||
@@ -176,8 +176,6 @@ static inline int sad_pkg(const struct interleave_pkg *table, u32 reg, | |||
176 | 176 | ||
177 | #define SAD_CONTROL 0xf4 | 177 | #define SAD_CONTROL 0xf4 |
178 | 178 | ||
179 | #define NODE_ID(reg) GET_BITFIELD(reg, 0, 2) | ||
180 | |||
181 | /* Device 14 function 0 */ | 179 | /* Device 14 function 0 */ |
182 | 180 | ||
183 | static const u32 tad_dram_rule[] = { | 181 | static const u32 tad_dram_rule[] = { |
@@ -303,6 +301,7 @@ struct sbridge_info { | |||
303 | const struct interleave_pkg *interleave_pkg; | 301 | const struct interleave_pkg *interleave_pkg; |
304 | u8 max_sad; | 302 | u8 max_sad; |
305 | u8 max_interleave; | 303 | u8 max_interleave; |
304 | u8 (*get_node_id)(struct sbridge_pvt *pvt); | ||
306 | enum mem_type (*get_memory_type)(struct sbridge_pvt *pvt); | 305 | enum mem_type (*get_memory_type)(struct sbridge_pvt *pvt); |
307 | }; | 306 | }; |
308 | 307 | ||
@@ -606,6 +605,13 @@ static enum mem_type get_memory_type(struct sbridge_pvt *pvt) | |||
606 | return mtype; | 605 | return mtype; |
607 | } | 606 | } |
608 | 607 | ||
608 | static u8 get_node_id(struct sbridge_pvt *pvt) | ||
609 | { | ||
610 | u32 reg; | ||
611 | pci_read_config_dword(pvt->pci_br0, SAD_CONTROL, ®); | ||
612 | return GET_BITFIELD(reg, 0, 2); | ||
613 | } | ||
614 | |||
609 | static inline u8 sad_pkg_socket(u8 pkg) | 615 | static inline u8 sad_pkg_socket(u8 pkg) |
610 | { | 616 | { |
611 | /* on Ivy Bridge, nodeID is SASS, where A is HA and S is node id */ | 617 | /* on Ivy Bridge, nodeID is SASS, where A is HA and S is node id */ |
@@ -682,8 +688,7 @@ static int get_dimm_config(struct mem_ctl_info *mci) | |||
682 | pci_read_config_dword(pvt->pci_br0, SAD_TARGET, ®); | 688 | pci_read_config_dword(pvt->pci_br0, SAD_TARGET, ®); |
683 | pvt->sbridge_dev->source_id = SOURCE_ID(reg); | 689 | pvt->sbridge_dev->source_id = SOURCE_ID(reg); |
684 | 690 | ||
685 | pci_read_config_dword(pvt->pci_br0, SAD_CONTROL, ®); | 691 | pvt->sbridge_dev->node_id = pvt->info.get_node_id(pvt); |
686 | pvt->sbridge_dev->node_id = NODE_ID(reg); | ||
687 | edac_dbg(0, "mc#%d: Node ID: %d, source ID: %d\n", | 692 | edac_dbg(0, "mc#%d: Node ID: %d, source ID: %d\n", |
688 | pvt->sbridge_dev->mc, | 693 | pvt->sbridge_dev->mc, |
689 | pvt->sbridge_dev->node_id, | 694 | pvt->sbridge_dev->node_id, |
@@ -1987,6 +1992,7 @@ static int sbridge_register_mci(struct sbridge_dev *sbridge_dev, enum type type) | |||
1987 | pvt->info.get_tohm = ibridge_get_tohm; | 1992 | pvt->info.get_tohm = ibridge_get_tohm; |
1988 | pvt->info.dram_rule = ibridge_dram_rule; | 1993 | pvt->info.dram_rule = ibridge_dram_rule; |
1989 | pvt->info.get_memory_type = get_memory_type; | 1994 | pvt->info.get_memory_type = get_memory_type; |
1995 | pvt->info.get_node_id = get_node_id; | ||
1990 | pvt->info.max_sad = ARRAY_SIZE(ibridge_dram_rule); | 1996 | pvt->info.max_sad = ARRAY_SIZE(ibridge_dram_rule); |
1991 | pvt->info.interleave_list = ibridge_interleave_list; | 1997 | pvt->info.interleave_list = ibridge_interleave_list; |
1992 | pvt->info.max_interleave = ARRAY_SIZE(ibridge_interleave_list); | 1998 | pvt->info.max_interleave = ARRAY_SIZE(ibridge_interleave_list); |
@@ -2003,6 +2009,7 @@ static int sbridge_register_mci(struct sbridge_dev *sbridge_dev, enum type type) | |||
2003 | pvt->info.get_tohm = sbridge_get_tohm; | 2009 | pvt->info.get_tohm = sbridge_get_tohm; |
2004 | pvt->info.dram_rule = sbridge_dram_rule; | 2010 | pvt->info.dram_rule = sbridge_dram_rule; |
2005 | pvt->info.get_memory_type = get_memory_type; | 2011 | pvt->info.get_memory_type = get_memory_type; |
2012 | pvt->info.get_node_id = get_node_id; | ||
2006 | pvt->info.max_sad = ARRAY_SIZE(sbridge_dram_rule); | 2013 | pvt->info.max_sad = ARRAY_SIZE(sbridge_dram_rule); |
2007 | pvt->info.interleave_list = sbridge_interleave_list; | 2014 | pvt->info.interleave_list = sbridge_interleave_list; |
2008 | pvt->info.max_interleave = ARRAY_SIZE(sbridge_interleave_list); | 2015 | pvt->info.max_interleave = ARRAY_SIZE(sbridge_interleave_list); |