amd_nb.h 1.5 KB
Newer Older
1 2
#ifndef _ASM_X86_AMD_NB_H
#define _ASM_X86_AMD_NB_H
3 4 5

#include <linux/pci.h>

6 7 8 9 10 11
struct amd_nb_bus_dev_range {
	u8 bus;
	u8 dev_base;
	u8 dev_limit;
};

12
extern const struct pci_device_id amd_nb_misc_ids[];
13
extern const struct amd_nb_bus_dev_range amd_nb_bus_dev_ranges[];
R
Randy Dunlap 已提交
14
struct bootnode;
15

16
extern bool early_is_amd_nb(u32 value);
17
extern int amd_cache_northbridges(void);
18 19 20
extern void amd_flush_garts(void);
extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn);
extern int amd_scan_nodes(void);
21 22
extern int amd_get_subcaches(int);
extern int amd_set_subcaches(int, int);
23

24
#ifdef CONFIG_NUMA_EMU
25
extern void amd_fake_nodes(const struct bootnode *nodes, int nr_nodes);
26
extern void amd_get_nodes(struct bootnode *nodes);
27 28
#endif

29 30
struct amd_northbridge {
	struct pci_dev *misc;
31
	struct pci_dev *link;
32 33
};

34
struct amd_northbridge_info {
35
	u16 num;
36 37
	u64 flags;
	struct amd_northbridge *nb;
38
};
39
extern struct amd_northbridge_info amd_northbridges;
40

41 42 43
#define AMD_NB_GART			BIT(0)
#define AMD_NB_L3_INDEX_DISABLE		BIT(1)
#define AMD_NB_L3_PARTITIONING		BIT(2)
44

45
#ifdef CONFIG_AMD_NB
46

47
static inline u16 amd_nb_num(void)
48
{
49
	return amd_northbridges.num;
50
}
51

52
static inline bool amd_nb_has_feature(unsigned feature)
53 54 55
{
	return ((amd_northbridges.flags & feature) == feature);
}
56

57
static inline struct amd_northbridge *node_to_amd_nb(int node)
58
{
59
	return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
60
}
61 62 63 64 65 66 67

#else

#define amd_nb_num(x)		0
#define amd_nb_has_feature(x)	false
#define node_to_amd_nb(x)	NULL

68 69 70
#endif


71
#endif /* _ASM_X86_AMD_NB_H */