diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-12-18 07:06:25 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-25 06:04:03 -0500 |
| commit | cc6e75af8df7aa40019ff58357170c8dd960281f (patch) | |
| tree | a82c61d4f7af8bf96d238530ced587e1d28854f6 /include/linux/amba | |
| parent | 2eac58d5026e4ec8b17ff8b62877fea9e1d2f1b3 (diff) | |
ARM: amba: provide common initializers for static amba devices
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/linux/amba')
| -rw-r--r-- | include/linux/amba/bus.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index e1929620e5a8..a9fab831caf8 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -92,4 +92,37 @@ void amba_release_regions(struct amba_device *); | |||
| 92 | #define amba_manf(d) AMBA_MANF_BITS((d)->periphid) | 92 | #define amba_manf(d) AMBA_MANF_BITS((d)->periphid) |
| 93 | #define amba_part(d) AMBA_PART_BITS((d)->periphid) | 93 | #define amba_part(d) AMBA_PART_BITS((d)->periphid) |
| 94 | 94 | ||
| 95 | #define __AMBA_DEV(busid, data, mask) \ | ||
| 96 | { \ | ||
| 97 | .coherent_dma_mask = mask, \ | ||
| 98 | .init_name = busid, \ | ||
| 99 | .platform_data = data, \ | ||
| 100 | } | ||
| 101 | |||
| 102 | /* | ||
| 103 | * APB devices do not themselves have the ability to address memory, | ||
| 104 | * so DMA masks should be zero (much like USB peripheral devices.) | ||
| 105 | * The DMA controller DMA masks should be used instead (much like | ||
| 106 | * USB host controllers in conventional PCs.) | ||
| 107 | */ | ||
| 108 | #define AMBA_APB_DEVICE(name, busid, id, base, irqs, data) \ | ||
| 109 | struct amba_device name##_device = { \ | ||
| 110 | .dev = __AMBA_DEV(busid, data, 0), \ | ||
| 111 | .res = DEFINE_RES_MEM(base, SZ_4K), \ | ||
| 112 | .irq = irqs, \ | ||
| 113 | .periphid = id, \ | ||
| 114 | } | ||
| 115 | |||
| 116 | /* | ||
| 117 | * AHB devices are DMA capable, so set their DMA masks | ||
| 118 | */ | ||
| 119 | #define AMBA_AHB_DEVICE(name, busid, id, base, irqs, data) \ | ||
| 120 | struct amba_device name##_device = { \ | ||
| 121 | .dev = __AMBA_DEV(busid, data, ~0ULL), \ | ||
| 122 | .res = DEFINE_RES_MEM(base, SZ_4K), \ | ||
| 123 | .dma_mask = ~0ULL, \ | ||
| 124 | .irq = irqs, \ | ||
| 125 | .periphid = id, \ | ||
| 126 | } | ||
| 127 | |||
| 95 | #endif | 128 | #endif |
