diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2012-02-27 12:22:36 -0500 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2012-02-29 07:03:08 -0500 |
| commit | 7eca30aef7961e68ad74c0ef920546c2be7f6579 (patch) | |
| tree | d7161459a86134bee58b8a0980a15b66839467aa /include/linux | |
| parent | d65b4e98d7ea3038b767b70fe8be959b2913f16d (diff) | |
| parent | d5e5a7f987458f42f24a557a0f4e35f94c43fc09 (diff) | |
Merge branch 'at91-3.4-base2+cleanup' of git://github.com/at91linux/linux-at91 into at91/staging/base2+cleanup
* 'at91-3.4-base2+cleanup' of git://github.com/at91linux/linux-at91: (20 commits)
ARM: at91: properly sort dtb files in Makefile.boot
ARM: at91: add at91sam9g25ek.dts in Makefile.boot
ARM: at91/board-dt: drop default console
Atmel: move console default platform_device to serial driver
ARM: at91: merge SRAM Memory banks thanks to mirroring
ARM: at91: finally drop at91_sys_read/write
ARM: at91/rtc-at91sam9: pass the GPBR to use via resources
ARM: at91:rtc/rtc-at91sam9: ioremap register bank
ARM: at91/rtc-at91sam9: each SoC can select the RTT device to use
ARM: at91/PMC: make register base soc independent
ARM: at91/PMC: move assignment out of printf
ARM: at91/pm_slowclock: add runtime detection of memory contoller
ARM: at91: make sdram/ddr register base soc independent
ARM: at91: move at91rm9200 sdramc defines to at91rm9200_sdramc.h
ARM: at91/pm_slowclock: function slow_clock() accepts parameters
ARM: at91/pm_slowclock: rename register to named define
ARM: at91/ST: remove not needed casts
ARM: at91: make ST (System Timer) soc independent
ARM: at91: make matrix register base soc independent
ARM: at91/at91x40: remove use of at91_sys_read/write
Based on top of the at91/9x5, rmk/for-armsoc, at91/device-board,
at91/pm_cleanup and at91/base.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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; | |||
| 60 | 60 | ||
| 61 | int amba_driver_register(struct amba_driver *); | 61 | int amba_driver_register(struct amba_driver *); |
| 62 | void amba_driver_unregister(struct amba_driver *); | 62 | void amba_driver_unregister(struct amba_driver *); |
| 63 | struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t); | ||
| 64 | void amba_device_put(struct amba_device *); | ||
| 65 | int amba_device_add(struct amba_device *, struct resource *); | ||
| 63 | int amba_device_register(struct amba_device *, struct resource *); | 66 | int amba_device_register(struct amba_device *, struct resource *); |
| 64 | void amba_device_unregister(struct amba_device *); | 67 | void amba_device_unregister(struct amba_device *); |
| 65 | struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); | 68 | 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 *); | |||
| 89 | #define amba_manf(d) AMBA_MANF_BITS((d)->periphid) | 92 | #define amba_manf(d) AMBA_MANF_BITS((d)->periphid) |
| 90 | #define amba_part(d) AMBA_PART_BITS((d)->periphid) | 93 | #define amba_part(d) AMBA_PART_BITS((d)->periphid) |
| 91 | 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 | |||
| 92 | #endif | 128 | #endif |
