blob: 980f22567631fca144e701272d47324aff62d186 [file] [log] [blame]
Andreas Herrmann23ac4ae2010-09-17 18:03:43 +02001#ifndef _ASM_X86_AMD_NB_H
2#define _ASM_X86_AMD_NB_H
Andi Kleena32073b2006-06-26 13:56:40 +02003
4#include <linux/pci.h>
5
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +02006extern struct pci_device_id amd_nb_misc_ids[];
Randy Dunlap04201012009-10-28 16:09:55 -07007struct bootnode;
Andi Kleena32073b2006-06-26 13:56:40 +02008
Hans Rosenfeldeec1d4f2010-10-29 17:14:30 +02009extern int early_is_amd_nb(u32 value);
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020010extern int amd_cache_northbridges(void);
Hans Rosenfeldeec1d4f2010-10-29 17:14:30 +020011extern void amd_flush_garts(void);
Hans Rosenfeldeec1d4f2010-10-29 17:14:30 +020012extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn);
13extern int amd_scan_nodes(void);
Andi Kleena32073b2006-06-26 13:56:40 +020014
David Rientjes4e76f4e2010-12-22 17:23:47 -080015#ifdef CONFIG_NUMA_EMU
David Rientjesf51bf302010-12-22 17:23:51 -080016extern void amd_fake_nodes(const struct bootnode *nodes, int nr_nodes);
David Rientjesa387e952010-12-22 17:23:56 -080017extern void amd_get_nodes(struct bootnode *nodes);
David Rientjes4e76f4e2010-12-22 17:23:47 -080018#endif
19
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020020struct amd_northbridge {
21 struct pci_dev *misc;
22};
23
Hans Rosenfeldeec1d4f2010-10-29 17:14:30 +020024struct amd_northbridge_info {
Andreas Herrmann900f9ac2010-09-17 18:02:54 +020025 u16 num;
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020026 u64 flags;
27 struct amd_northbridge *nb;
Andreas Herrmann900f9ac2010-09-17 18:02:54 +020028};
Hans Rosenfeldeec1d4f2010-10-29 17:14:30 +020029extern struct amd_northbridge_info amd_northbridges;
Andreas Herrmann900f9ac2010-09-17 18:02:54 +020030
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020031#define AMD_NB_GART 0x1
Hans Rosenfeldf658bcf2010-10-29 17:14:32 +020032#define AMD_NB_L3_INDEX_DISABLE 0x2
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020033
Andreas Herrmann23ac4ae2010-09-17 18:03:43 +020034#ifdef CONFIG_AMD_NB
Borislav Petkovade029e2010-04-24 09:56:53 +020035
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020036static inline int amd_nb_num(void)
Jaswinder Singh Rajputb2065252009-04-14 23:04:37 +053037{
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020038 return amd_northbridges.num;
39}
40
41static inline int amd_nb_has_feature(int feature)
42{
43 return ((amd_northbridges.flags & feature) == feature);
44}
45
46static inline struct amd_northbridge *node_to_amd_nb(int node)
47{
48 return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
Jaswinder Singh Rajputb2065252009-04-14 23:04:37 +053049}
Borislav Petkovade029e2010-04-24 09:56:53 +020050
Andreas Herrmannafd9fce2009-04-09 15:16:17 +020051#else
Borislav Petkovade029e2010-04-24 09:56:53 +020052
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020053#define amd_nb_num(x) 0
54#define amd_nb_has_feature(x) false
55#define node_to_amd_nb(x) NULL
56
Andreas Herrmannafd9fce2009-04-09 15:16:17 +020057#endif
58
59
Andreas Herrmann23ac4ae2010-09-17 18:03:43 +020060#endif /* _ASM_X86_AMD_NB_H */