aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/amd_nb.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/amd_nb.h')
-rw-r--r--arch/x86/include/asm/amd_nb.h34
1 files changed, 25 insertions, 9 deletions
diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h
index 35b17a821e34..4d7ec7df7de2 100644
--- a/arch/x86/include/asm/amd_nb.h
+++ b/arch/x86/include/asm/amd_nb.h
@@ -3,36 +3,52 @@
3 3
4#include <linux/pci.h> 4#include <linux/pci.h>
5 5
6extern struct pci_device_id amd_nb_ids[]; 6extern struct pci_device_id amd_nb_misc_ids[];
7struct bootnode; 7struct bootnode;
8 8
9extern int early_is_amd_nb(u32 value); 9extern int early_is_amd_nb(u32 value);
10extern int cache_amd_northbridges(void); 10extern int amd_cache_northbridges(void);
11extern void amd_flush_garts(void); 11extern void amd_flush_garts(void);
12extern int amd_get_nodes(struct bootnode *nodes); 12extern int amd_get_nodes(struct bootnode *nodes);
13extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn); 13extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn);
14extern int amd_scan_nodes(void); 14extern int amd_scan_nodes(void);
15 15
16struct amd_northbridge {
17 struct pci_dev *misc;
18};
19
16struct amd_northbridge_info { 20struct amd_northbridge_info {
17 u16 num; 21 u16 num;
18 u8 gart_supported; 22 u64 flags;
19 struct pci_dev **nb_misc; 23 struct amd_northbridge *nb;
20}; 24};
21extern struct amd_northbridge_info amd_northbridges; 25extern struct amd_northbridge_info amd_northbridges;
22 26
27#define AMD_NB_GART 0x1
28
23#ifdef CONFIG_AMD_NB 29#ifdef CONFIG_AMD_NB
24 30
25static inline struct pci_dev *node_to_amd_nb_misc(int node) 31static inline int amd_nb_num(void)
26{ 32{
27 return (node < amd_northbridges.num) ? amd_northbridges.nb_misc[node] : NULL; 33 return amd_northbridges.num;
28} 34}
29 35
30#else 36static inline int amd_nb_has_feature(int feature)
37{
38 return ((amd_northbridges.flags & feature) == feature);
39}
31 40
32static inline struct pci_dev *node_to_amd_nb_misc(int node) 41static inline struct amd_northbridge *node_to_amd_nb(int node)
33{ 42{
34 return NULL; 43 return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
35} 44}
45
46#else
47
48#define amd_nb_num(x) 0
49#define amd_nb_has_feature(x) false
50#define node_to_amd_nb(x) NULL
51
36#endif 52#endif
37 53
38 54