Andreas Herrmann | 23ac4ae | 2010-09-17 18:03:43 +0200 | [diff] [blame] | 1 | #ifndef _ASM_X86_AMD_NB_H |
| 2 | #define _ASM_X86_AMD_NB_H |
Andi Kleen | a32073b | 2006-06-26 13:56:40 +0200 | [diff] [blame] | 3 | |
| 4 | #include <linux/pci.h> |
| 5 | |
Hans Rosenfeld | 9653a5c | 2010-10-29 17:14:31 +0200 | [diff] [blame] | 6 | extern struct pci_device_id amd_nb_misc_ids[]; |
Randy Dunlap | 0420101 | 2009-10-28 16:09:55 -0700 | [diff] [blame] | 7 | struct bootnode; |
Andi Kleen | a32073b | 2006-06-26 13:56:40 +0200 | [diff] [blame] | 8 | |
Hans Rosenfeld | eec1d4f | 2010-10-29 17:14:30 +0200 | [diff] [blame] | 9 | extern int early_is_amd_nb(u32 value); |
Hans Rosenfeld | 9653a5c | 2010-10-29 17:14:31 +0200 | [diff] [blame] | 10 | extern int amd_cache_northbridges(void); |
Hans Rosenfeld | eec1d4f | 2010-10-29 17:14:30 +0200 | [diff] [blame] | 11 | extern void amd_flush_garts(void); |
Hans Rosenfeld | eec1d4f | 2010-10-29 17:14:30 +0200 | [diff] [blame] | 12 | extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn); |
| 13 | extern int amd_scan_nodes(void); |
Andi Kleen | a32073b | 2006-06-26 13:56:40 +0200 | [diff] [blame] | 14 | |
David Rientjes | 4e76f4e | 2010-12-22 17:23:47 -0800 | [diff] [blame^] | 15 | #ifdef CONFIG_NUMA_EMU |
| 16 | extern int amd_get_nodes(struct bootnode *nodes); |
| 17 | #endif |
| 18 | |
Hans Rosenfeld | 9653a5c | 2010-10-29 17:14:31 +0200 | [diff] [blame] | 19 | struct amd_northbridge { |
| 20 | struct pci_dev *misc; |
| 21 | }; |
| 22 | |
Hans Rosenfeld | eec1d4f | 2010-10-29 17:14:30 +0200 | [diff] [blame] | 23 | struct amd_northbridge_info { |
Andreas Herrmann | 900f9ac | 2010-09-17 18:02:54 +0200 | [diff] [blame] | 24 | u16 num; |
Hans Rosenfeld | 9653a5c | 2010-10-29 17:14:31 +0200 | [diff] [blame] | 25 | u64 flags; |
| 26 | struct amd_northbridge *nb; |
Andreas Herrmann | 900f9ac | 2010-09-17 18:02:54 +0200 | [diff] [blame] | 27 | }; |
Hans Rosenfeld | eec1d4f | 2010-10-29 17:14:30 +0200 | [diff] [blame] | 28 | extern struct amd_northbridge_info amd_northbridges; |
Andreas Herrmann | 900f9ac | 2010-09-17 18:02:54 +0200 | [diff] [blame] | 29 | |
Hans Rosenfeld | 9653a5c | 2010-10-29 17:14:31 +0200 | [diff] [blame] | 30 | #define AMD_NB_GART 0x1 |
Hans Rosenfeld | f658bcf | 2010-10-29 17:14:32 +0200 | [diff] [blame] | 31 | #define AMD_NB_L3_INDEX_DISABLE 0x2 |
Hans Rosenfeld | 9653a5c | 2010-10-29 17:14:31 +0200 | [diff] [blame] | 32 | |
Andreas Herrmann | 23ac4ae | 2010-09-17 18:03:43 +0200 | [diff] [blame] | 33 | #ifdef CONFIG_AMD_NB |
Borislav Petkov | ade029e | 2010-04-24 09:56:53 +0200 | [diff] [blame] | 34 | |
Hans Rosenfeld | 9653a5c | 2010-10-29 17:14:31 +0200 | [diff] [blame] | 35 | static inline int amd_nb_num(void) |
Jaswinder Singh Rajput | b206525 | 2009-04-14 23:04:37 +0530 | [diff] [blame] | 36 | { |
Hans Rosenfeld | 9653a5c | 2010-10-29 17:14:31 +0200 | [diff] [blame] | 37 | return amd_northbridges.num; |
| 38 | } |
| 39 | |
| 40 | static inline int amd_nb_has_feature(int feature) |
| 41 | { |
| 42 | return ((amd_northbridges.flags & feature) == feature); |
| 43 | } |
| 44 | |
| 45 | static inline struct amd_northbridge *node_to_amd_nb(int node) |
| 46 | { |
| 47 | return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL; |
Jaswinder Singh Rajput | b206525 | 2009-04-14 23:04:37 +0530 | [diff] [blame] | 48 | } |
Borislav Petkov | ade029e | 2010-04-24 09:56:53 +0200 | [diff] [blame] | 49 | |
Andreas Herrmann | afd9fce | 2009-04-09 15:16:17 +0200 | [diff] [blame] | 50 | #else |
Borislav Petkov | ade029e | 2010-04-24 09:56:53 +0200 | [diff] [blame] | 51 | |
Hans Rosenfeld | 9653a5c | 2010-10-29 17:14:31 +0200 | [diff] [blame] | 52 | #define amd_nb_num(x) 0 |
| 53 | #define amd_nb_has_feature(x) false |
| 54 | #define node_to_amd_nb(x) NULL |
| 55 | |
Andreas Herrmann | afd9fce | 2009-04-09 15:16:17 +0200 | [diff] [blame] | 56 | #endif |
| 57 | |
| 58 | |
Andreas Herrmann | 23ac4ae | 2010-09-17 18:03:43 +0200 | [diff] [blame] | 59 | #endif /* _ASM_X86_AMD_NB_H */ |