6 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
8 #include <linux/types.h>
9 #include <linux/slab.h>
11 #include <linux/errno.h>
12 #include <linux/module.h>
16 static u32 *flush_words;
63 while ((misc = next_northbridge(misc, amd_nb_misc_ids)) !=
NULL)
79 next_northbridge(misc, amd_nb_misc_ids);
81 next_northbridge(link, amd_nb_link_ids);
120 for (
id = amd_nb_misc_ids;
id->
vendor;
id++)
130 unsigned segn_busn_bits;
140 rdmsrl(address, msr);
153 res->
end = base + (1ULL<<(segn_busn_bits + 20)) - 1;
166 pci_read_config_dword(link, 0x1d4, &mask);
168 cuid =
cpu_data(cpu).compute_unit_id;
169 return (mask >> (4 * cuid)) & 0xf;
174 static unsigned int reset, ban;
184 pci_read_config_dword(nb->
link, 0x1d4, &reset);
185 pci_read_config_dword(nb->
misc, 0x1b8, &ban);
191 pci_read_config_dword(nb->
misc, 0x1b8, ®);
192 pci_write_config_dword(nb->
misc, 0x1b8, reg & ~0x180000);
195 cuid =
cpu_data(cpu).compute_unit_id;
197 mask |= (0xf ^ (1 << cuid)) << 26;
199 pci_write_config_dword(nb->
link, 0x1d4, mask);
202 pci_read_config_dword(nb->
link, 0x1d4, ®);
204 pci_read_config_dword(nb->
misc, 0x1b8, ®);
206 pci_write_config_dword(nb->
misc, 0x1b8, reg | ban);
212 static int amd_cache_gart(
void)
263 spin_unlock_irqrestore(&gart_lock, flags);
269 static __init int init_amd_nbs(
void)
276 pr_notice(
"Cannot enumerate AMD northbridges\n");
278 if (amd_cache_gart() < 0)
279 pr_notice(
"Cannot initialize GART flush words, GART support disabled\n");