blob: d57c08acedfc2e5f1167a1f3a861094662c486fb [file] [log] [blame]
Benjamin Herrenschmidtc6dbaef2006-11-11 17:18:39 +11001/*
2 * Arch specific extensions to struct device
3 *
4 * This file is released under the GPLv2
5 */
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +11006#ifndef _ASM_POWERPC_DEVICE_H
7#define _ASM_POWERPC_DEVICE_H
Benjamin Herrenschmidtc6dbaef2006-11-11 17:18:39 +11008
FUJITA Tomonori45223c52009-08-04 19:08:25 +00009struct dma_map_ops;
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110010struct device_node;
11
Nishanth Aravamudanf6aedd82010-10-26 17:35:11 +000012/*
13 * Arch extensions to struct device.
14 *
15 * When adding fields, consider macio_add_one_device in
16 * drivers/macintosh/macio_asic.c
17 */
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110018struct dev_archdata {
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110019 /* DMA operations on that device */
FUJITA Tomonori45223c52009-08-04 19:08:25 +000020 struct dma_map_ops *dma_ops;
Becky Bruce738ef422009-09-21 08:26:35 +000021
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
FUJITA Tomonori762afb72009-08-04 19:08:22 +000031#ifdef CONFIG_SWIOTLB
32 dma_addr_t max_direct_dma_addr;
33#endif
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110034};
35
Magnus Dammd7aacad2009-07-08 13:21:31 +020036struct pdev_archdata {
Grant Likelycb6dc512010-04-13 16:12:59 -070037 u64 dma_mask;
Magnus Dammd7aacad2009-07-08 13:21:31 +020038};
39
Milton Millerd24f9c62011-06-24 09:05:24 +000040#define ARCH_HAS_DMA_GET_REQUIRED_MASK
41
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110042#endif /* _ASM_POWERPC_DEVICE_H */