diff options
| author | Olof Johansson <olof@lixom.net> | 2012-03-04 11:16:38 -0800 |
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2012-03-04 11:16:38 -0800 |
| commit | 0e86ca498511d1ff1224a5be7224c83cfcf000e3 (patch) | |
| tree | 47d9f2d94862f7b7c0bc952af41631dfaa220ead /include/linux | |
| parent | f35b431dde39fb40944d1024f08d88fbf04a3193 (diff) | |
| parent | a5f17d1f4c2831b9b9bf8b1a537cdbac995d6e13 (diff) | |
Merge branch 'depends/rmk/for-armsoc' into for-3.4/cleanup-and-fixes
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/amba/bus.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 724c69c40bb8..a9fab831caf8 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -60,6 +60,9 @@ extern struct bus_type amba_bustype; int amba_driver_register(struct amba_driver *); void amba_driver_unregister(struct amba_driver *); +struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t); +void amba_device_put(struct amba_device *); +int amba_device_add(struct amba_device *, struct resource *); int amba_device_register(struct amba_device *, struct resource *); void amba_device_unregister(struct amba_device *); struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); @@ -89,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 |
