blob: 9c16cde63f04604e52387ec6e6d3412e2ebc5d50 [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
16extern int amd_get_nodes(struct bootnode *nodes);
17#endif
18
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020019struct amd_northbridge {
20 struct pci_dev *misc;
21};
22
Hans Rosenfeldeec1d4f2010-10-29 17:14:30 +020023struct amd_northbridge_info {
Andreas Herrmann900f9ac2010-09-17 18:02:54 +020024 u16 num;
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020025 u64 flags;
26 struct amd_northbridge *nb;
Andreas Herrmann900f9ac2010-09-17 18:02:54 +020027};
Hans Rosenfeldeec1d4f2010-10-29 17:14:30 +020028extern struct amd_northbridge_info amd_northbridges;
Andreas Herrmann900f9ac2010-09-17 18:02:54 +020029
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020030#define AMD_NB_GART 0x1
Hans Rosenfeldf658bcf2010-10-29 17:14:32 +020031#define AMD_NB_L3_INDEX_DISABLE 0x2
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020032
Andreas Herrmann23ac4ae2010-09-17 18:03:43 +020033#ifdef CONFIG_AMD_NB
Borislav Petkovade029e2010-04-24 09:56:53 +020034
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020035static inline int amd_nb_num(void)
Jaswinder Singh Rajputb2065252009-04-14 23:04:37 +053036{
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020037 return amd_northbridges.num;
38}
39
40static inline int amd_nb_has_feature(int feature)
41{
42 return ((amd_northbridges.flags & feature) == feature);
43}
44
45static inline struct amd_northbridge *node_to_amd_nb(int node)
46{
47 return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
Jaswinder Singh Rajputb2065252009-04-14 23:04:37 +053048}
Borislav Petkovade029e2010-04-24 09:56:53 +020049
Andreas Herrmannafd9fce2009-04-09 15:16:17 +020050#else
Borislav Petkovade029e2010-04-24 09:56:53 +020051
Hans Rosenfeld9653a5c2010-10-29 17:14:31 +020052#define amd_nb_num(x) 0
53#define amd_nb_has_feature(x) false
54#define node_to_amd_nb(x) NULL
55
Andreas Herrmannafd9fce2009-04-09 15:16:17 +020056#endif
57
58
Andreas Herrmann23ac4ae2010-09-17 18:03:43 +020059#endif /* _ASM_X86_AMD_NB_H */