2010-09-17 16:03:43 +00:00
|
|
|
#ifndef _ASM_X86_AMD_NB_H
|
|
|
|
#define _ASM_X86_AMD_NB_H
|
2006-06-26 11:56:40 +00:00
|
|
|
|
|
|
|
#include <linux/pci.h>
|
|
|
|
|
2011-01-10 16:20:23 +00:00
|
|
|
struct amd_nb_bus_dev_range {
|
|
|
|
u8 bus;
|
|
|
|
u8 dev_base;
|
|
|
|
u8 dev_limit;
|
|
|
|
};
|
|
|
|
|
2010-10-29 15:14:31 +00:00
|
|
|
extern struct pci_device_id amd_nb_misc_ids[];
|
2011-01-10 16:20:23 +00:00
|
|
|
extern const struct amd_nb_bus_dev_range amd_nb_bus_dev_ranges[];
|
2009-10-28 23:09:55 +00:00
|
|
|
struct bootnode;
|
2006-06-26 11:56:40 +00:00
|
|
|
|
2010-10-29 15:14:30 +00:00
|
|
|
extern int early_is_amd_nb(u32 value);
|
2010-10-29 15:14:31 +00:00
|
|
|
extern int amd_cache_northbridges(void);
|
2010-10-29 15:14:30 +00:00
|
|
|
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);
|
2011-02-07 17:10:39 +00:00
|
|
|
extern int amd_get_subcaches(int);
|
|
|
|
extern int amd_set_subcaches(int, int);
|
2006-06-26 11:56:40 +00:00
|
|
|
|
2010-12-23 01:23:47 +00:00
|
|
|
#ifdef CONFIG_NUMA_EMU
|
2010-12-23 01:23:51 +00:00
|
|
|
extern void amd_fake_nodes(const struct bootnode *nodes, int nr_nodes);
|
2010-12-23 01:23:56 +00:00
|
|
|
extern void amd_get_nodes(struct bootnode *nodes);
|
2010-12-23 01:23:47 +00:00
|
|
|
#endif
|
|
|
|
|
2010-10-29 15:14:31 +00:00
|
|
|
struct amd_northbridge {
|
|
|
|
struct pci_dev *misc;
|
2011-01-24 15:05:42 +00:00
|
|
|
struct pci_dev *link;
|
2010-10-29 15:14:31 +00:00
|
|
|
};
|
|
|
|
|
2010-10-29 15:14:30 +00:00
|
|
|
struct amd_northbridge_info {
|
2010-09-17 16:02:54 +00:00
|
|
|
u16 num;
|
2010-10-29 15:14:31 +00:00
|
|
|
u64 flags;
|
|
|
|
struct amd_northbridge *nb;
|
2010-09-17 16:02:54 +00:00
|
|
|
};
|
2010-10-29 15:14:30 +00:00
|
|
|
extern struct amd_northbridge_info amd_northbridges;
|
2010-09-17 16:02:54 +00:00
|
|
|
|
2010-10-29 15:14:31 +00:00
|
|
|
#define AMD_NB_GART 0x1
|
2010-10-29 15:14:32 +00:00
|
|
|
#define AMD_NB_L3_INDEX_DISABLE 0x2
|
2011-02-07 17:10:39 +00:00
|
|
|
#define AMD_NB_L3_PARTITIONING 0x4
|
2010-10-29 15:14:31 +00:00
|
|
|
|
2010-09-17 16:03:43 +00:00
|
|
|
#ifdef CONFIG_AMD_NB
|
2010-04-24 07:56:53 +00:00
|
|
|
|
2010-10-29 15:14:31 +00:00
|
|
|
static inline int amd_nb_num(void)
|
2009-04-14 17:34:37 +00:00
|
|
|
{
|
2010-10-29 15:14:31 +00:00
|
|
|
return amd_northbridges.num;
|
2009-04-14 17:34:37 +00:00
|
|
|
}
|
2010-04-24 07:56:53 +00:00
|
|
|
|
2010-10-29 15:14:31 +00:00
|
|
|
static inline int amd_nb_has_feature(int feature)
|
|
|
|
{
|
|
|
|
return ((amd_northbridges.flags & feature) == feature);
|
|
|
|
}
|
2010-04-24 07:56:53 +00:00
|
|
|
|
2010-10-29 15:14:31 +00:00
|
|
|
static inline struct amd_northbridge *node_to_amd_nb(int node)
|
2009-04-14 17:34:37 +00:00
|
|
|
{
|
2010-10-29 15:14:31 +00:00
|
|
|
return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
|
2009-04-14 17:34:37 +00:00
|
|
|
}
|
2010-10-29 15:14:31 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define amd_nb_num(x) 0
|
|
|
|
#define amd_nb_has_feature(x) false
|
|
|
|
#define node_to_amd_nb(x) NULL
|
|
|
|
|
2009-04-09 13:16:17 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2010-09-17 16:03:43 +00:00
|
|
|
#endif /* _ASM_X86_AMD_NB_H */
|