device.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Arch specific extensions to struct device
  3. *
  4. * This file is released under the GPLv2
  5. */
  6. #ifndef _ASM_POWERPC_DEVICE_H
  7. #define _ASM_POWERPC_DEVICE_H
  8. struct dma_map_ops;
  9. struct device_node;
  10. #ifdef CONFIG_PPC64
  11. struct pci_dn;
  12. #endif
  13. /*
  14. * Arch extensions to struct device.
  15. *
  16. * When adding fields, consider macio_add_one_device in
  17. * drivers/macintosh/macio_asic.c
  18. */
  19. struct dev_archdata {
  20. /* DMA operations on that device */
  21. struct dma_map_ops *dma_ops;
  22. /*
  23. * When an iommu is in use, dma_data is used as a ptr to the base of the
  24. * iommu_table. Otherwise, it is a simple numerical offset.
  25. */
  26. union {
  27. dma_addr_t dma_offset;
  28. void *iommu_table_base;
  29. } dma_data;
  30. #ifdef CONFIG_IOMMU_API
  31. void *iommu_domain;
  32. #endif
  33. #ifdef CONFIG_SWIOTLB
  34. dma_addr_t max_direct_dma_addr;
  35. #endif
  36. #ifdef CONFIG_PPC64
  37. struct pci_dn *pci_data;
  38. #endif
  39. #ifdef CONFIG_EEH
  40. struct eeh_dev *edev;
  41. #endif
  42. #ifdef CONFIG_FAIL_IOMMU
  43. int fail_iommu;
  44. #endif
  45. };
  46. struct pdev_archdata {
  47. u64 dma_mask;
  48. };
  49. #define ARCH_HAS_DMA_GET_REQUIRED_MASK
  50. #endif /* _ASM_POWERPC_DEVICE_H */