device.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Arch specific extensions to struct device
  4. */
  5. #ifndef _ASM_POWERPC_DEVICE_H
  6. #define _ASM_POWERPC_DEVICE_H
  7. struct device_node;
  8. #ifdef CONFIG_PPC64
  9. struct pci_dn;
  10. struct iommu_table;
  11. #endif
  12. /*
  13. * Arch extensions to struct device.
  14. *
  15. * When adding fields, consider macio_add_one_device in
  16. * drivers/macintosh/macio_asic.c
  17. */
  18. struct dev_archdata {
  19. /*
  20. * These two used to be a union. However, with the hybrid ops we need
  21. * both so here we store both a DMA offset for direct mappings and
  22. * an iommu_table for remapped DMA.
  23. */
  24. dma_addr_t dma_offset;
  25. #ifdef CONFIG_PPC64
  26. struct iommu_table *iommu_table_base;
  27. #endif
  28. #ifdef CONFIG_PPC64
  29. struct pci_dn *pci_data;
  30. #endif
  31. #ifdef CONFIG_EEH
  32. struct eeh_dev *edev;
  33. #endif
  34. #ifdef CONFIG_FAIL_IOMMU
  35. int fail_iommu;
  36. #endif
  37. #ifdef CONFIG_CXL_BASE
  38. struct cxl_context *cxl_ctx;
  39. #endif
  40. #ifdef CONFIG_PCI_IOV
  41. void *iov_data;
  42. #endif
  43. };
  44. struct pdev_archdata {
  45. u64 dma_mask;
  46. /*
  47. * Pointer to nvdimm_pmu structure, to handle the unregistering
  48. * of pmu device
  49. */
  50. void *priv;
  51. };
  52. #endif /* _ASM_POWERPC_DEVICE_H */