diff options
Diffstat (limited to 'include/linux/amba')
| -rw-r--r-- | include/linux/amba/bus.h | 15 | ||||
| -rw-r--r-- | include/linux/amba/clcd.h | 1 | ||||
| -rw-r--r-- | include/linux/amba/mmci.h | 2 | ||||
| -rw-r--r-- | include/linux/amba/pl022.h | 13 | ||||
| -rw-r--r-- | include/linux/amba/pl08x.h | 222 | ||||
| -rw-r--r-- | include/linux/amba/serial.h | 11 |
6 files changed, 253 insertions, 11 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index b0c174012436..c6454cca0447 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/resource.h> | 20 | #include <linux/resource.h> |
| 21 | 21 | ||
| 22 | #define AMBA_NR_IRQS 2 | 22 | #define AMBA_NR_IRQS 2 |
| 23 | #define AMBA_CID 0xb105f00d | ||
| 23 | 24 | ||
| 24 | struct clk; | 25 | struct clk; |
| 25 | 26 | ||
| @@ -70,9 +71,15 @@ void amba_release_regions(struct amba_device *); | |||
| 70 | #define amba_pclk_disable(d) \ | 71 | #define amba_pclk_disable(d) \ |
| 71 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) | 72 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) |
| 72 | 73 | ||
| 73 | #define amba_config(d) (((d)->periphid >> 24) & 0xff) | 74 | /* Some drivers don't use the struct amba_device */ |
| 74 | #define amba_rev(d) (((d)->periphid >> 20) & 0x0f) | 75 | #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) |
| 75 | #define amba_manf(d) (((d)->periphid >> 12) & 0xff) | 76 | #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) |
| 76 | #define amba_part(d) ((d)->periphid & 0xfff) | 77 | #define AMBA_MANF_BITS(a) (((a) >> 12) & 0xff) |
| 78 | #define AMBA_PART_BITS(a) ((a) & 0xfff) | ||
| 79 | |||
| 80 | #define amba_config(d) AMBA_CONFIG_BITS((d)->periphid) | ||
| 81 | #define amba_rev(d) AMBA_REV_BITS((d)->periphid) | ||
| 82 | #define amba_manf(d) AMBA_MANF_BITS((d)->periphid) | ||
| 83 | #define amba_part(d) AMBA_PART_BITS((d)->periphid) | ||
| 77 | 84 | ||
| 78 | #endif | 85 | #endif |
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h index ca16c3801a1e..be33b3affc8a 100644 --- a/include/linux/amba/clcd.h +++ b/include/linux/amba/clcd.h | |||
| @@ -150,6 +150,7 @@ struct clcd_fb { | |||
| 150 | u16 off_cntl; | 150 | u16 off_cntl; |
| 151 | u32 clcd_cntl; | 151 | u32 clcd_cntl; |
| 152 | u32 cmap[16]; | 152 | u32 cmap[16]; |
| 153 | bool clk_enabled; | ||
| 153 | }; | 154 | }; |
| 154 | 155 | ||
| 155 | static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | 156 | static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) |
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h index ca84ce70d5d5..f4ee9acc9721 100644 --- a/include/linux/amba/mmci.h +++ b/include/linux/amba/mmci.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | * whether a card is present in the MMC slot or not | 24 | * whether a card is present in the MMC slot or not |
| 25 | * @gpio_wp: read this GPIO pin to see if the card is write protected | 25 | * @gpio_wp: read this GPIO pin to see if the card is write protected |
| 26 | * @gpio_cd: read this GPIO pin to detect card insertion | 26 | * @gpio_cd: read this GPIO pin to detect card insertion |
| 27 | * @cd_invert: true if the gpio_cd pin value is active low | ||
| 27 | * @capabilities: the capabilities of the block as implemented in | 28 | * @capabilities: the capabilities of the block as implemented in |
| 28 | * this platform, signify anything MMC_CAP_* from mmc/host.h | 29 | * this platform, signify anything MMC_CAP_* from mmc/host.h |
| 29 | */ | 30 | */ |
| @@ -35,6 +36,7 @@ struct mmci_platform_data { | |||
| 35 | unsigned int (*status)(struct device *); | 36 | unsigned int (*status)(struct device *); |
| 36 | int gpio_wp; | 37 | int gpio_wp; |
| 37 | int gpio_cd; | 38 | int gpio_cd; |
| 39 | bool cd_invert; | ||
| 38 | unsigned long capabilities; | 40 | unsigned long capabilities; |
| 39 | }; | 41 | }; |
| 40 | 42 | ||
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h index abf26cc47a2b..4ce98f54186b 100644 --- a/include/linux/amba/pl022.h +++ b/include/linux/amba/pl022.h | |||
| @@ -228,6 +228,7 @@ enum ssp_chip_select { | |||
| 228 | }; | 228 | }; |
| 229 | 229 | ||
| 230 | 230 | ||
| 231 | struct dma_chan; | ||
| 231 | /** | 232 | /** |
| 232 | * struct pl022_ssp_master - device.platform_data for SPI controller devices. | 233 | * struct pl022_ssp_master - device.platform_data for SPI controller devices. |
| 233 | * @num_chipselect: chipselects are used to distinguish individual | 234 | * @num_chipselect: chipselects are used to distinguish individual |
| @@ -235,11 +236,16 @@ enum ssp_chip_select { | |||
| 235 | * each slave has a chipselect signal, but it's common that not | 236 | * each slave has a chipselect signal, but it's common that not |
| 236 | * every chipselect is connected to a slave. | 237 | * every chipselect is connected to a slave. |
| 237 | * @enable_dma: if true enables DMA driven transfers. | 238 | * @enable_dma: if true enables DMA driven transfers. |
| 239 | * @dma_rx_param: parameter to locate an RX DMA channel. | ||
| 240 | * @dma_tx_param: parameter to locate a TX DMA channel. | ||
| 238 | */ | 241 | */ |
| 239 | struct pl022_ssp_controller { | 242 | struct pl022_ssp_controller { |
| 240 | u16 bus_id; | 243 | u16 bus_id; |
| 241 | u8 num_chipselect; | 244 | u8 num_chipselect; |
| 242 | u8 enable_dma:1; | 245 | u8 enable_dma:1; |
| 246 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | ||
| 247 | void *dma_rx_param; | ||
| 248 | void *dma_tx_param; | ||
| 243 | }; | 249 | }; |
| 244 | 250 | ||
| 245 | /** | 251 | /** |
| @@ -270,20 +276,13 @@ struct pl022_ssp_controller { | |||
| 270 | * @dma_config: DMA configuration for SSP controller and peripheral | 276 | * @dma_config: DMA configuration for SSP controller and peripheral |
| 271 | */ | 277 | */ |
| 272 | struct pl022_config_chip { | 278 | struct pl022_config_chip { |
| 273 | struct device *dev; | ||
| 274 | enum ssp_loopback lbm; | ||
| 275 | enum ssp_interface iface; | 279 | enum ssp_interface iface; |
| 276 | enum ssp_hierarchy hierarchy; | 280 | enum ssp_hierarchy hierarchy; |
| 277 | bool slave_tx_disable; | 281 | bool slave_tx_disable; |
| 278 | struct ssp_clock_params clk_freq; | 282 | struct ssp_clock_params clk_freq; |
| 279 | enum ssp_rx_endian endian_rx; | ||
| 280 | enum ssp_tx_endian endian_tx; | ||
| 281 | enum ssp_data_size data_size; | ||
| 282 | enum ssp_mode com_mode; | 283 | enum ssp_mode com_mode; |
| 283 | enum ssp_rx_level_trig rx_lev_trig; | 284 | enum ssp_rx_level_trig rx_lev_trig; |
| 284 | enum ssp_tx_level_trig tx_lev_trig; | 285 | enum ssp_tx_level_trig tx_lev_trig; |
| 285 | enum ssp_spi_clk_phase clk_phase; | ||
| 286 | enum ssp_spi_clk_pol clk_pol; | ||
| 287 | enum ssp_microwire_ctrl_len ctrl_len; | 286 | enum ssp_microwire_ctrl_len ctrl_len; |
| 288 | enum ssp_microwire_wait_state wait_state; | 287 | enum ssp_microwire_wait_state wait_state; |
| 289 | enum ssp_duplex duplex; | 288 | enum ssp_duplex duplex; |
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h new file mode 100644 index 000000000000..521a0f8974ac --- /dev/null +++ b/include/linux/amba/pl08x.h | |||
| @@ -0,0 +1,222 @@ | |||
| 1 | /* | ||
| 2 | * linux/amba/pl08x.h - ARM PrimeCell DMA Controller driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005 ARM Ltd | ||
| 5 | * Copyright (C) 2010 ST-Ericsson SA | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * pl08x information required by platform code | ||
| 12 | * | ||
| 13 | * Please credit ARM.com | ||
| 14 | * Documentation: ARM DDI 0196D | ||
| 15 | * | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef AMBA_PL08X_H | ||
| 19 | #define AMBA_PL08X_H | ||
| 20 | |||
| 21 | /* We need sizes of structs from this header */ | ||
| 22 | #include <linux/dmaengine.h> | ||
| 23 | #include <linux/interrupt.h> | ||
| 24 | |||
| 25 | /** | ||
| 26 | * struct pl08x_channel_data - data structure to pass info between | ||
| 27 | * platform and PL08x driver regarding channel configuration | ||
| 28 | * @bus_id: name of this device channel, not just a device name since | ||
| 29 | * devices may have more than one channel e.g. "foo_tx" | ||
| 30 | * @min_signal: the minimum DMA signal number to be muxed in for this | ||
| 31 | * channel (for platforms supporting muxed signals). If you have | ||
| 32 | * static assignments, make sure this is set to the assigned signal | ||
| 33 | * number, PL08x have 16 possible signals in number 0 thru 15 so | ||
| 34 | * when these are not enough they often get muxed (in hardware) | ||
| 35 | * disabling simultaneous use of the same channel for two devices. | ||
| 36 | * @max_signal: the maximum DMA signal number to be muxed in for | ||
| 37 | * the channel. Set to the same as min_signal for | ||
| 38 | * devices with static assignments | ||
| 39 | * @muxval: a number usually used to poke into some mux regiser to | ||
| 40 | * mux in the signal to this channel | ||
| 41 | * @cctl_opt: default options for the channel control register | ||
| 42 | * @addr: source/target address in physical memory for this DMA channel, | ||
| 43 | * can be the address of a FIFO register for burst requests for example. | ||
| 44 | * This can be left undefined if the PrimeCell API is used for configuring | ||
| 45 | * this. | ||
| 46 | * @circular_buffer: whether the buffer passed in is circular and | ||
| 47 | * shall simply be looped round round (like a record baby round | ||
| 48 | * round round round) | ||
| 49 | * @single: the device connected to this channel will request single | ||
| 50 | * DMA transfers, not bursts. (Bursts are default.) | ||
| 51 | */ | ||
| 52 | struct pl08x_channel_data { | ||
| 53 | char *bus_id; | ||
| 54 | int min_signal; | ||
| 55 | int max_signal; | ||
| 56 | u32 muxval; | ||
| 57 | u32 cctl; | ||
| 58 | u32 ccfg; | ||
| 59 | dma_addr_t addr; | ||
| 60 | bool circular_buffer; | ||
| 61 | bool single; | ||
| 62 | }; | ||
| 63 | |||
| 64 | /** | ||
| 65 | * Struct pl08x_bus_data - information of source or destination | ||
| 66 | * busses for a transfer | ||
| 67 | * @addr: current address | ||
| 68 | * @maxwidth: the maximum width of a transfer on this bus | ||
| 69 | * @buswidth: the width of this bus in bytes: 1, 2 or 4 | ||
| 70 | * @fill_bytes: bytes required to fill to the next bus memory | ||
| 71 | * boundary | ||
| 72 | */ | ||
| 73 | struct pl08x_bus_data { | ||
| 74 | dma_addr_t addr; | ||
| 75 | u8 maxwidth; | ||
| 76 | u8 buswidth; | ||
| 77 | u32 fill_bytes; | ||
| 78 | }; | ||
| 79 | |||
| 80 | /** | ||
| 81 | * struct pl08x_phy_chan - holder for the physical channels | ||
| 82 | * @id: physical index to this channel | ||
| 83 | * @lock: a lock to use when altering an instance of this struct | ||
| 84 | * @signal: the physical signal (aka channel) serving this | ||
| 85 | * physical channel right now | ||
| 86 | * @serving: the virtual channel currently being served by this | ||
| 87 | * physical channel | ||
| 88 | */ | ||
| 89 | struct pl08x_phy_chan { | ||
| 90 | unsigned int id; | ||
| 91 | void __iomem *base; | ||
| 92 | spinlock_t lock; | ||
| 93 | int signal; | ||
| 94 | struct pl08x_dma_chan *serving; | ||
| 95 | u32 csrc; | ||
| 96 | u32 cdst; | ||
| 97 | u32 clli; | ||
| 98 | u32 cctl; | ||
| 99 | u32 ccfg; | ||
| 100 | }; | ||
| 101 | |||
| 102 | /** | ||
| 103 | * struct pl08x_txd - wrapper for struct dma_async_tx_descriptor | ||
| 104 | * @llis_bus: DMA memory address (physical) start for the LLIs | ||
| 105 | * @llis_va: virtual memory address start for the LLIs | ||
| 106 | */ | ||
| 107 | struct pl08x_txd { | ||
| 108 | struct dma_async_tx_descriptor tx; | ||
| 109 | struct list_head node; | ||
| 110 | enum dma_data_direction direction; | ||
| 111 | struct pl08x_bus_data srcbus; | ||
| 112 | struct pl08x_bus_data dstbus; | ||
| 113 | int len; | ||
| 114 | dma_addr_t llis_bus; | ||
| 115 | void *llis_va; | ||
| 116 | struct pl08x_channel_data *cd; | ||
| 117 | bool active; | ||
| 118 | /* | ||
| 119 | * Settings to be put into the physical channel when we | ||
| 120 | * trigger this txd | ||
| 121 | */ | ||
| 122 | u32 csrc; | ||
| 123 | u32 cdst; | ||
| 124 | u32 clli; | ||
| 125 | u32 cctl; | ||
| 126 | }; | ||
| 127 | |||
| 128 | /** | ||
| 129 | * struct pl08x_dma_chan_state - holds the PL08x specific virtual | ||
| 130 | * channel states | ||
| 131 | * @PL08X_CHAN_IDLE: the channel is idle | ||
| 132 | * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport | ||
| 133 | * channel and is running a transfer on it | ||
| 134 | * @PL08X_CHAN_PAUSED: the channel has allocated a physical transport | ||
| 135 | * channel, but the transfer is currently paused | ||
| 136 | * @PL08X_CHAN_WAITING: the channel is waiting for a physical transport | ||
| 137 | * channel to become available (only pertains to memcpy channels) | ||
| 138 | */ | ||
| 139 | enum pl08x_dma_chan_state { | ||
| 140 | PL08X_CHAN_IDLE, | ||
| 141 | PL08X_CHAN_RUNNING, | ||
| 142 | PL08X_CHAN_PAUSED, | ||
| 143 | PL08X_CHAN_WAITING, | ||
| 144 | }; | ||
| 145 | |||
| 146 | /** | ||
| 147 | * struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel | ||
| 148 | * @chan: wrappped abstract channel | ||
| 149 | * @phychan: the physical channel utilized by this channel, if there is one | ||
| 150 | * @tasklet: tasklet scheduled by the IRQ to handle actual work etc | ||
| 151 | * @name: name of channel | ||
| 152 | * @cd: channel platform data | ||
| 153 | * @runtime_addr: address for RX/TX according to the runtime config | ||
| 154 | * @runtime_direction: current direction of this channel according to | ||
| 155 | * runtime config | ||
| 156 | * @lc: last completed transaction on this channel | ||
| 157 | * @desc_list: queued transactions pending on this channel | ||
| 158 | * @at: active transaction on this channel | ||
| 159 | * @lockflags: sometimes we let a lock last between two function calls, | ||
| 160 | * especially prep/submit, and then we need to store the IRQ flags | ||
| 161 | * in the channel state, here | ||
| 162 | * @lock: a lock for this channel data | ||
| 163 | * @host: a pointer to the host (internal use) | ||
| 164 | * @state: whether the channel is idle, paused, running etc | ||
| 165 | * @slave: whether this channel is a device (slave) or for memcpy | ||
| 166 | * @waiting: a TX descriptor on this channel which is waiting for | ||
| 167 | * a physical channel to become available | ||
| 168 | */ | ||
| 169 | struct pl08x_dma_chan { | ||
| 170 | struct dma_chan chan; | ||
| 171 | struct pl08x_phy_chan *phychan; | ||
| 172 | struct tasklet_struct tasklet; | ||
| 173 | char *name; | ||
| 174 | struct pl08x_channel_data *cd; | ||
| 175 | dma_addr_t runtime_addr; | ||
| 176 | enum dma_data_direction runtime_direction; | ||
| 177 | atomic_t last_issued; | ||
| 178 | dma_cookie_t lc; | ||
| 179 | struct list_head desc_list; | ||
| 180 | struct pl08x_txd *at; | ||
| 181 | unsigned long lockflags; | ||
| 182 | spinlock_t lock; | ||
| 183 | void *host; | ||
| 184 | enum pl08x_dma_chan_state state; | ||
| 185 | bool slave; | ||
| 186 | struct pl08x_txd *waiting; | ||
| 187 | }; | ||
| 188 | |||
| 189 | /** | ||
| 190 | * struct pl08x_platform_data - the platform configuration for the | ||
| 191 | * PL08x PrimeCells. | ||
| 192 | * @slave_channels: the channels defined for the different devices on the | ||
| 193 | * platform, all inclusive, including multiplexed channels. The available | ||
| 194 | * physical channels will be multiplexed around these signals as they | ||
| 195 | * are requested, just enumerate all possible channels. | ||
| 196 | * @get_signal: request a physical signal to be used for a DMA | ||
| 197 | * transfer immediately: if there is some multiplexing or similar blocking | ||
| 198 | * the use of the channel the transfer can be denied by returning | ||
| 199 | * less than zero, else it returns the allocated signal number | ||
| 200 | * @put_signal: indicate to the platform that this physical signal is not | ||
| 201 | * running any DMA transfer and multiplexing can be recycled | ||
| 202 | * @bus_bit_lli: Bit[0] of the address indicated which AHB bus master the | ||
| 203 | * LLI addresses are on 0/1 Master 1/2. | ||
| 204 | */ | ||
| 205 | struct pl08x_platform_data { | ||
| 206 | struct pl08x_channel_data *slave_channels; | ||
| 207 | unsigned int num_slave_channels; | ||
| 208 | struct pl08x_channel_data memcpy_channel; | ||
| 209 | int (*get_signal)(struct pl08x_dma_chan *); | ||
| 210 | void (*put_signal)(struct pl08x_dma_chan *); | ||
| 211 | }; | ||
| 212 | |||
| 213 | #ifdef CONFIG_AMBA_PL08X | ||
| 214 | bool pl08x_filter_id(struct dma_chan *chan, void *chan_id); | ||
| 215 | #else | ||
| 216 | static inline bool pl08x_filter_id(struct dma_chan *chan, void *chan_id) | ||
| 217 | { | ||
| 218 | return false; | ||
| 219 | } | ||
| 220 | #endif | ||
| 221 | |||
| 222 | #endif /* AMBA_PL08X_H */ | ||
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index e1b634b635f2..6021588ba0a8 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
| @@ -32,7 +32,9 @@ | |||
| 32 | #define UART01x_RSR 0x04 /* Receive status register (Read). */ | 32 | #define UART01x_RSR 0x04 /* Receive status register (Read). */ |
| 33 | #define UART01x_ECR 0x04 /* Error clear register (Write). */ | 33 | #define UART01x_ECR 0x04 /* Error clear register (Write). */ |
| 34 | #define UART010_LCRH 0x08 /* Line control register, high byte. */ | 34 | #define UART010_LCRH 0x08 /* Line control register, high byte. */ |
| 35 | #define ST_UART011_DMAWM 0x08 /* DMA watermark configure register. */ | ||
| 35 | #define UART010_LCRM 0x0C /* Line control register, middle byte. */ | 36 | #define UART010_LCRM 0x0C /* Line control register, middle byte. */ |
| 37 | #define ST_UART011_TIMEOUT 0x0C /* Timeout period register. */ | ||
| 36 | #define UART010_LCRL 0x10 /* Line control register, low byte. */ | 38 | #define UART010_LCRL 0x10 /* Line control register, low byte. */ |
| 37 | #define UART010_CR 0x14 /* Control register. */ | 39 | #define UART010_CR 0x14 /* Control register. */ |
| 38 | #define UART01x_FR 0x18 /* Flag register (Read only). */ | 40 | #define UART01x_FR 0x18 /* Flag register (Read only). */ |
| @@ -51,6 +53,15 @@ | |||
| 51 | #define UART011_MIS 0x40 /* Masked interrupt status. */ | 53 | #define UART011_MIS 0x40 /* Masked interrupt status. */ |
| 52 | #define UART011_ICR 0x44 /* Interrupt clear register. */ | 54 | #define UART011_ICR 0x44 /* Interrupt clear register. */ |
| 53 | #define UART011_DMACR 0x48 /* DMA control register. */ | 55 | #define UART011_DMACR 0x48 /* DMA control register. */ |
| 56 | #define ST_UART011_XFCR 0x50 /* XON/XOFF control register. */ | ||
| 57 | #define ST_UART011_XON1 0x54 /* XON1 register. */ | ||
| 58 | #define ST_UART011_XON2 0x58 /* XON2 register. */ | ||
| 59 | #define ST_UART011_XOFF1 0x5C /* XON1 register. */ | ||
| 60 | #define ST_UART011_XOFF2 0x60 /* XON2 register. */ | ||
| 61 | #define ST_UART011_ITCR 0x80 /* Integration test control register. */ | ||
| 62 | #define ST_UART011_ITIP 0x84 /* Integration test input register. */ | ||
| 63 | #define ST_UART011_ABCR 0x100 /* Autobaud control register. */ | ||
| 64 | #define ST_UART011_ABIMSC 0x15C /* Autobaud interrupt mask/clear register. */ | ||
| 54 | 65 | ||
| 55 | #define UART011_DR_OE (1 << 11) | 66 | #define UART011_DR_OE (1 << 11) |
| 56 | #define UART011_DR_BE (1 << 10) | 67 | #define UART011_DR_BE (1 << 10) |
