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>
This commit is contained in:
parent
2eac58d502
commit
cc6e75af8d
1 changed files with 33 additions and 0 deletions
|
@ -92,4 +92,37 @@ void amba_release_regions(struct amba_device *);
|
|||
#define amba_manf(d) AMBA_MANF_BITS((d)->periphid)
|
||||
#define amba_part(d) AMBA_PART_BITS((d)->periphid)
|
||||
|
||||
#define __AMBA_DEV(busid, data, mask) \
|
||||
{ \
|
||||
.coherent_dma_mask = mask, \
|
||||
.init_name = busid, \
|
||||
.platform_data = data, \
|
||||
}
|
||||
|
||||
/*
|
||||
* APB devices do not themselves have the ability to address memory,
|
||||
* so DMA masks should be zero (much like USB peripheral devices.)
|
||||
* The DMA controller DMA masks should be used instead (much like
|
||||
* USB host controllers in conventional PCs.)
|
||||
*/
|
||||
#define AMBA_APB_DEVICE(name, busid, id, base, irqs, data) \
|
||||
struct amba_device name##_device = { \
|
||||
.dev = __AMBA_DEV(busid, data, 0), \
|
||||
.res = DEFINE_RES_MEM(base, SZ_4K), \
|
||||
.irq = irqs, \
|
||||
.periphid = id, \
|
||||
}
|
||||
|
||||
/*
|
||||
* AHB devices are DMA capable, so set their DMA masks
|
||||
*/
|
||||
#define AMBA_AHB_DEVICE(name, busid, id, base, irqs, data) \
|
||||
struct amba_device name##_device = { \
|
||||
.dev = __AMBA_DEV(busid, data, ~0ULL), \
|
||||
.res = DEFINE_RES_MEM(base, SZ_4K), \
|
||||
.dma_mask = ~0ULL, \
|
||||
.irq = irqs, \
|
||||
.periphid = id, \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue