device.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. struct iommu_table;
  13. #endif
  14. /*
  15. * Arch extensions to struct device.
  16. *
  17. * When adding fields, consider macio_add_one_device in
  18. * drivers/macintosh/macio_asic.c
  19. */
  20. struct dev_archdata {
  21. /* DMA operations on that device */
  22. struct dma_map_ops *dma_ops;
  23. /*
  24. * These two used to be a union. However, with the hybrid ops we need
  25. * both so here we store both a DMA offset for direct mappings and
  26. * an iommu_table for remapped DMA.
  27. */
  28. dma_addr_t dma_offset;
  29. #ifdef CONFIG_PPC64
  30. struct iommu_table *iommu_table_base;
  31. #endif
  32. #ifdef CONFIG_IOMMU_API
  33. void *iommu_domain;
  34. #endif
  35. #ifdef CONFIG_SWIOTLB
  36. dma_addr_t max_direct_dma_addr;
  37. #endif
  38. #ifdef CONFIG_PPC64
  39. struct pci_dn *pci_data;
  40. #endif
  41. #ifdef CONFIG_EEH
  42. struct eeh_dev *edev;
  43. #endif
  44. #ifdef CONFIG_FAIL_IOMMU
  45. int fail_iommu;
  46. #endif
  47. #ifdef CONFIG_CXL_BASE
  48. struct cxl_context *cxl_ctx;
  49. #endif
  50. };
  51. struct pdev_archdata {
  52. u64 dma_mask;
  53. };
  54. #define ARCH_HAS_DMA_GET_REQUIRED_MASK
  55. #endif /* _ASM_POWERPC_DEVICE_H */