blob: 6d94d27ed850a7110627f943398e65b885665075 [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
12struct dev_archdata {
13 /* Optional pointer to an OF device node */
14 struct device_node *of_node;
15
16 /* DMA operations on that device */
FUJITA Tomonori45223c52009-08-04 19:08:25 +000017 struct dma_map_ops *dma_ops;
Becky Bruce738ef422009-09-21 08:26:35 +000018
19 /*
20 * When an iommu is in use, dma_data is used as a ptr to the base of the
21 * iommu_table. Otherwise, it is a simple numerical offset.
22 */
23 union {
24 dma_addr_t dma_offset;
25 void *iommu_table_base;
26 } dma_data;
27
FUJITA Tomonori762afb72009-08-04 19:08:22 +000028#ifdef CONFIG_SWIOTLB
29 dma_addr_t max_direct_dma_addr;
30#endif
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110031};
32
Anton Vorontsov3f3b1632008-11-28 09:13:23 +000033static inline void dev_archdata_set_node(struct dev_archdata *ad,
34 struct device_node *np)
35{
36 ad->of_node = np;
37}
38
39static inline struct device_node *
40dev_archdata_get_node(const struct dev_archdata *ad)
41{
42 return ad->of_node;
43}
44
Magnus Dammd7aacad2009-07-08 13:21:31 +020045struct pdev_archdata {
46};
47
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110048#endif /* _ASM_POWERPC_DEVICE_H */