amd_nb.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 const 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 bool 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(void);
  16. extern int amd_get_subcaches(int);
  17. extern int amd_set_subcaches(int, int);
  18. struct amd_northbridge {
  19. struct pci_dev *misc;
  20. struct pci_dev *link;
  21. };
  22. struct amd_northbridge_info {
  23. u16 num;
  24. u64 flags;
  25. struct amd_northbridge *nb;
  26. };
  27. extern struct amd_northbridge_info amd_northbridges;
  28. #define AMD_NB_GART BIT(0)
  29. #define AMD_NB_L3_INDEX_DISABLE BIT(1)
  30. #define AMD_NB_L3_PARTITIONING BIT(2)
  31. #ifdef CONFIG_AMD_NB
  32. static inline u16 amd_nb_num(void)
  33. {
  34. return amd_northbridges.num;
  35. }
  36. static inline bool amd_nb_has_feature(unsigned feature)
  37. {
  38. return ((amd_northbridges.flags & feature) == feature);
  39. }
  40. static inline struct amd_northbridge *node_to_amd_nb(int node)
  41. {
  42. return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
  43. }
  44. #else
  45. #define amd_nb_num(x) 0
  46. #define amd_nb_has_feature(x) false
  47. #define node_to_amd_nb(x) NULL
  48. #endif
  49. #endif /* _ASM_X86_AMD_NB_H */