amd_nb.h 1.4 KB

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