amd_nb.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _ASM_X86_AMD_NB_H
  2. #define _ASM_X86_AMD_NB_H
  3. #include <linux/pci.h>
  4. extern struct pci_device_id amd_nb_misc_ids[];
  5. struct bootnode;
  6. extern int early_is_amd_nb(u32 value);
  7. extern int amd_cache_northbridges(void);
  8. extern void amd_flush_garts(void);
  9. extern int amd_get_nodes(struct bootnode *nodes);
  10. extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn);
  11. extern int amd_scan_nodes(void);
  12. struct amd_northbridge {
  13. struct pci_dev *misc;
  14. };
  15. struct amd_northbridge_info {
  16. u16 num;
  17. u64 flags;
  18. struct amd_northbridge *nb;
  19. };
  20. extern struct amd_northbridge_info amd_northbridges;
  21. #define AMD_NB_GART 0x1
  22. #define AMD_NB_L3_INDEX_DISABLE 0x2
  23. #ifdef CONFIG_AMD_NB
  24. static inline int amd_nb_num(void)
  25. {
  26. return amd_northbridges.num;
  27. }
  28. static inline int amd_nb_has_feature(int feature)
  29. {
  30. return ((amd_northbridges.flags & feature) == feature);
  31. }
  32. static inline struct amd_northbridge *node_to_amd_nb(int node)
  33. {
  34. return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
  35. }
  36. #else
  37. #define amd_nb_num(x) 0
  38. #define amd_nb_has_feature(x) false
  39. #define node_to_amd_nb(x) NULL
  40. #endif
  41. #endif /* _ASM_X86_AMD_NB_H */