diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/linux/amba | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'include/linux/amba')
-rw-r--r-- | include/linux/amba/bus.h | 77 | ||||
-rw-r--r-- | include/linux/amba/mmci.h | 34 | ||||
-rw-r--r-- | include/linux/amba/pl022.h | 20 | ||||
-rw-r--r-- | include/linux/amba/pl061.h | 3 | ||||
-rw-r--r-- | include/linux/amba/pl08x.h | 135 | ||||
-rw-r--r-- | include/linux/amba/pl330.h | 20 | ||||
-rw-r--r-- | include/linux/amba/serial.h | 3 |
7 files changed, 181 insertions, 111 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 43ec7e247a8..fcbbe71a3cc 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -16,7 +16,6 @@ | |||
16 | 16 | ||
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/mod_devicetable.h> | ||
20 | #include <linux/err.h> | 19 | #include <linux/err.h> |
21 | #include <linux/resource.h> | 20 | #include <linux/resource.h> |
22 | #include <linux/regulator/consumer.h> | 21 | #include <linux/regulator/consumer.h> |
@@ -30,11 +29,18 @@ struct amba_device { | |||
30 | struct device dev; | 29 | struct device dev; |
31 | struct resource res; | 30 | struct resource res; |
32 | struct clk *pclk; | 31 | struct clk *pclk; |
32 | struct regulator *vcore; | ||
33 | u64 dma_mask; | 33 | u64 dma_mask; |
34 | unsigned int periphid; | 34 | unsigned int periphid; |
35 | unsigned int irq[AMBA_NR_IRQS]; | 35 | unsigned int irq[AMBA_NR_IRQS]; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | struct amba_id { | ||
39 | unsigned int id; | ||
40 | unsigned int mask; | ||
41 | void *data; | ||
42 | }; | ||
43 | |||
38 | struct amba_driver { | 44 | struct amba_driver { |
39 | struct device_driver drv; | 45 | struct device_driver drv; |
40 | int (*probe)(struct amba_device *, const struct amba_id *); | 46 | int (*probe)(struct amba_device *, const struct amba_id *); |
@@ -59,28 +65,7 @@ extern struct bus_type amba_bustype; | |||
59 | 65 | ||
60 | int amba_driver_register(struct amba_driver *); | 66 | int amba_driver_register(struct amba_driver *); |
61 | void amba_driver_unregister(struct amba_driver *); | 67 | void amba_driver_unregister(struct amba_driver *); |
62 | struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t); | ||
63 | void amba_device_put(struct amba_device *); | ||
64 | int amba_device_add(struct amba_device *, struct resource *); | ||
65 | int amba_device_register(struct amba_device *, struct resource *); | 68 | int amba_device_register(struct amba_device *, struct resource *); |
66 | struct amba_device *amba_apb_device_add(struct device *parent, const char *name, | ||
67 | resource_size_t base, size_t size, | ||
68 | int irq1, int irq2, void *pdata, | ||
69 | unsigned int periphid); | ||
70 | struct amba_device *amba_ahb_device_add(struct device *parent, const char *name, | ||
71 | resource_size_t base, size_t size, | ||
72 | int irq1, int irq2, void *pdata, | ||
73 | unsigned int periphid); | ||
74 | struct amba_device * | ||
75 | amba_apb_device_add_res(struct device *parent, const char *name, | ||
76 | resource_size_t base, size_t size, int irq1, | ||
77 | int irq2, void *pdata, unsigned int periphid, | ||
78 | struct resource *resbase); | ||
79 | struct amba_device * | ||
80 | amba_ahb_device_add_res(struct device *parent, const char *name, | ||
81 | resource_size_t base, size_t size, int irq1, | ||
82 | int irq2, void *pdata, unsigned int periphid, | ||
83 | struct resource *resbase); | ||
84 | void amba_device_unregister(struct amba_device *); | 69 | void amba_device_unregister(struct amba_device *); |
85 | struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); | 70 | struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); |
86 | int amba_request_regions(struct amba_device *, const char *); | 71 | int amba_request_regions(struct amba_device *, const char *); |
@@ -92,6 +77,12 @@ void amba_release_regions(struct amba_device *); | |||
92 | #define amba_pclk_disable(d) \ | 77 | #define amba_pclk_disable(d) \ |
93 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) | 78 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) |
94 | 79 | ||
80 | #define amba_vcore_enable(d) \ | ||
81 | (IS_ERR((d)->vcore) ? 0 : regulator_enable((d)->vcore)) | ||
82 | |||
83 | #define amba_vcore_disable(d) \ | ||
84 | do { if (!IS_ERR((d)->vcore)) regulator_disable((d)->vcore); } while (0) | ||
85 | |||
95 | /* Some drivers don't use the struct amba_device */ | 86 | /* Some drivers don't use the struct amba_device */ |
96 | #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) | 87 | #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) |
97 | #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) | 88 | #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) |
@@ -103,46 +94,4 @@ void amba_release_regions(struct amba_device *); | |||
103 | #define amba_manf(d) AMBA_MANF_BITS((d)->periphid) | 94 | #define amba_manf(d) AMBA_MANF_BITS((d)->periphid) |
104 | #define amba_part(d) AMBA_PART_BITS((d)->periphid) | 95 | #define amba_part(d) AMBA_PART_BITS((d)->periphid) |
105 | 96 | ||
106 | #define __AMBA_DEV(busid, data, mask) \ | ||
107 | { \ | ||
108 | .coherent_dma_mask = mask, \ | ||
109 | .init_name = busid, \ | ||
110 | .platform_data = data, \ | ||
111 | } | ||
112 | |||
113 | /* | ||
114 | * APB devices do not themselves have the ability to address memory, | ||
115 | * so DMA masks should be zero (much like USB peripheral devices.) | ||
116 | * The DMA controller DMA masks should be used instead (much like | ||
117 | * USB host controllers in conventional PCs.) | ||
118 | */ | ||
119 | #define AMBA_APB_DEVICE(name, busid, id, base, irqs, data) \ | ||
120 | struct amba_device name##_device = { \ | ||
121 | .dev = __AMBA_DEV(busid, data, 0), \ | ||
122 | .res = DEFINE_RES_MEM(base, SZ_4K), \ | ||
123 | .irq = irqs, \ | ||
124 | .periphid = id, \ | ||
125 | } | ||
126 | |||
127 | /* | ||
128 | * AHB devices are DMA capable, so set their DMA masks | ||
129 | */ | ||
130 | #define AMBA_AHB_DEVICE(name, busid, id, base, irqs, data) \ | ||
131 | struct amba_device name##_device = { \ | ||
132 | .dev = __AMBA_DEV(busid, data, ~0ULL), \ | ||
133 | .res = DEFINE_RES_MEM(base, SZ_4K), \ | ||
134 | .dma_mask = ~0ULL, \ | ||
135 | .irq = irqs, \ | ||
136 | .periphid = id, \ | ||
137 | } | ||
138 | |||
139 | /* | ||
140 | * module_amba_driver() - Helper macro for drivers that don't do anything | ||
141 | * special in module init/exit. This eliminates a lot of boilerplate. Each | ||
142 | * module may only use this macro once, and calling it replaces module_init() | ||
143 | * and module_exit() | ||
144 | */ | ||
145 | #define module_amba_driver(__amba_drv) \ | ||
146 | module_driver(__amba_drv, amba_driver_register, amba_driver_unregister) | ||
147 | |||
148 | #endif | 97 | #endif |
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h index 32a89cf5ec4..60c737f7bda 100644 --- a/include/linux/amba/mmci.h +++ b/include/linux/amba/mmci.h | |||
@@ -5,19 +5,15 @@ | |||
5 | #define AMBA_MMCI_H | 5 | #define AMBA_MMCI_H |
6 | 6 | ||
7 | #include <linux/mmc/host.h> | 7 | #include <linux/mmc/host.h> |
8 | #include <linux/mmc/card.h> | ||
9 | #include <linux/mmc/sdio_func.h> | ||
8 | 10 | ||
9 | 11 | struct embedded_sdio_data { | |
10 | /* | 12 | struct sdio_cis cis; |
11 | * These defines is places here due to access is needed from machine | 13 | struct sdio_cccr cccr; |
12 | * configuration files. The ST Micro version does not have ROD and | 14 | struct sdio_embedded_func *funcs; |
13 | * reuse the voltage registers for direction settings. | 15 | int num_funcs; |
14 | */ | 16 | }; |
15 | #define MCI_ST_DATA2DIREN (1 << 2) | ||
16 | #define MCI_ST_CMDDIREN (1 << 3) | ||
17 | #define MCI_ST_DATA0DIREN (1 << 4) | ||
18 | #define MCI_ST_DATA31DIREN (1 << 5) | ||
19 | #define MCI_ST_FBCLKEN (1 << 7) | ||
20 | #define MCI_ST_DATA74DIREN (1 << 8) | ||
21 | 17 | ||
22 | /* Just some dummy forwarding */ | 18 | /* Just some dummy forwarding */ |
23 | struct dma_chan; | 19 | struct dma_chan; |
@@ -31,8 +27,7 @@ struct dma_chan; | |||
31 | * @ocr_mask: available voltages on the 4 pins from the block, this | 27 | * @ocr_mask: available voltages on the 4 pins from the block, this |
32 | * is ignored if a regulator is used, see the MMC_VDD_* masks in | 28 | * is ignored if a regulator is used, see the MMC_VDD_* masks in |
33 | * mmc/host.h | 29 | * mmc/host.h |
34 | * @ios_handler: a callback function to act on specfic ios changes, | 30 | * @vdd_handler: a callback function to translate a MMC_VDD_* |
35 | * used for example to control a levelshifter | ||
36 | * mask into a value to be binary (or set some other custom bits | 31 | * mask into a value to be binary (or set some other custom bits |
37 | * in MMCIPWR) or:ed and written into the MMCIPWR register of the | 32 | * in MMCIPWR) or:ed and written into the MMCIPWR register of the |
38 | * block. May also control external power based on the power_mode. | 33 | * block. May also control external power based on the power_mode. |
@@ -44,9 +39,6 @@ struct dma_chan; | |||
44 | * @cd_invert: true if the gpio_cd pin value is active low | 39 | * @cd_invert: true if the gpio_cd pin value is active low |
45 | * @capabilities: the capabilities of the block as implemented in | 40 | * @capabilities: the capabilities of the block as implemented in |
46 | * this platform, signify anything MMC_CAP_* from mmc/host.h | 41 | * this platform, signify anything MMC_CAP_* from mmc/host.h |
47 | * @capabilities2: more capabilities, MMC_CAP2_* from mmc/host.h | ||
48 | * @sigdir: a bit field indicating for what bits in the MMC bus the host | ||
49 | * should enable signal direction indication. | ||
50 | * @dma_filter: function used to select an appropriate RX and TX | 42 | * @dma_filter: function used to select an appropriate RX and TX |
51 | * DMA channel to be used for DMA, if and only if you're deploying the | 43 | * DMA channel to be used for DMA, if and only if you're deploying the |
52 | * generic DMA engine | 44 | * generic DMA engine |
@@ -62,17 +54,19 @@ struct dma_chan; | |||
62 | struct mmci_platform_data { | 54 | struct mmci_platform_data { |
63 | unsigned int f_max; | 55 | unsigned int f_max; |
64 | unsigned int ocr_mask; | 56 | unsigned int ocr_mask; |
65 | int (*ios_handler)(struct device *, struct mmc_ios *); | 57 | u32 (*vdd_handler)(struct device *, unsigned int vdd, |
58 | unsigned char power_mode); | ||
66 | unsigned int (*status)(struct device *); | 59 | unsigned int (*status)(struct device *); |
67 | int gpio_wp; | 60 | int gpio_wp; |
68 | int gpio_cd; | 61 | int gpio_cd; |
69 | bool cd_invert; | 62 | bool cd_invert; |
70 | unsigned long capabilities; | 63 | unsigned long capabilities; |
71 | unsigned long capabilities2; | ||
72 | u32 sigdir; | ||
73 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | 64 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); |
74 | void *dma_rx_param; | 65 | void *dma_rx_param; |
75 | void *dma_tx_param; | 66 | void *dma_tx_param; |
67 | unsigned int status_irq; | ||
68 | struct embedded_sdio_data *embedded_sdio; | ||
69 | int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id); | ||
76 | }; | 70 | }; |
77 | 71 | ||
78 | #endif | 72 | #endif |
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h index 854b7294f6c..4ce98f54186 100644 --- a/include/linux/amba/pl022.h +++ b/include/linux/amba/pl022.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #ifndef _SSP_PL022_H | 25 | #ifndef _SSP_PL022_H |
26 | #define _SSP_PL022_H | 26 | #define _SSP_PL022_H |
27 | 27 | ||
28 | #include <linux/types.h> | 28 | #include <linux/device.h> |
29 | 29 | ||
30 | /** | 30 | /** |
31 | * whether SSP is in loopback mode or not | 31 | * whether SSP is in loopback mode or not |
@@ -231,7 +231,6 @@ enum ssp_chip_select { | |||
231 | struct dma_chan; | 231 | struct dma_chan; |
232 | /** | 232 | /** |
233 | * struct pl022_ssp_master - device.platform_data for SPI controller devices. | 233 | * struct pl022_ssp_master - device.platform_data for SPI controller devices. |
234 | * @bus_id: identifier for this bus | ||
235 | * @num_chipselect: chipselects are used to distinguish individual | 234 | * @num_chipselect: chipselects are used to distinguish individual |
236 | * SPI slaves, and are numbered from zero to num_chipselects - 1. | 235 | * SPI slaves, and are numbered from zero to num_chipselects - 1. |
237 | * 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 |
@@ -239,12 +238,6 @@ struct dma_chan; | |||
239 | * @enable_dma: if true enables DMA driven transfers. | 238 | * @enable_dma: if true enables DMA driven transfers. |
240 | * @dma_rx_param: parameter to locate an RX DMA channel. | 239 | * @dma_rx_param: parameter to locate an RX DMA channel. |
241 | * @dma_tx_param: parameter to locate a TX DMA channel. | 240 | * @dma_tx_param: parameter to locate a TX DMA channel. |
242 | * @autosuspend_delay: delay in ms following transfer completion before the | ||
243 | * runtime power management system suspends the device. A setting of 0 | ||
244 | * indicates no delay and the device will be suspended immediately. | ||
245 | * @rt: indicates the controller should run the message pump with realtime | ||
246 | * priority to minimise the transfer latency on the bus. | ||
247 | * @chipselects: list of <num_chipselects> chip select gpios | ||
248 | */ | 241 | */ |
249 | struct pl022_ssp_controller { | 242 | struct pl022_ssp_controller { |
250 | u16 bus_id; | 243 | u16 bus_id; |
@@ -253,22 +246,25 @@ struct pl022_ssp_controller { | |||
253 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | 246 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); |
254 | void *dma_rx_param; | 247 | void *dma_rx_param; |
255 | void *dma_tx_param; | 248 | void *dma_tx_param; |
256 | int autosuspend_delay; | ||
257 | bool rt; | ||
258 | int *chipselects; | ||
259 | }; | 249 | }; |
260 | 250 | ||
261 | /** | 251 | /** |
262 | * struct ssp_config_chip - spi_board_info.controller_data for SPI | 252 | * struct ssp_config_chip - spi_board_info.controller_data for SPI |
263 | * slave devices, copied to spi_device.controller_data. | 253 | * slave devices, copied to spi_device.controller_data. |
264 | * | 254 | * |
255 | * @lbm: used for test purpose to internally connect RX and TX | ||
265 | * @iface: Interface type(Motorola, TI, Microwire, Universal) | 256 | * @iface: Interface type(Motorola, TI, Microwire, Universal) |
266 | * @hierarchy: sets whether interface is master or slave | 257 | * @hierarchy: sets whether interface is master or slave |
267 | * @slave_tx_disable: SSPTXD is disconnected (in slave mode only) | 258 | * @slave_tx_disable: SSPTXD is disconnected (in slave mode only) |
268 | * @clk_freq: Tune freq parameters of SSP(when in master mode) | 259 | * @clk_freq: Tune freq parameters of SSP(when in master mode) |
260 | * @endian_rx: Endianess of Data in Rx FIFO | ||
261 | * @endian_tx: Endianess of Data in Tx FIFO | ||
262 | * @data_size: Width of data element(4 to 32 bits) | ||
269 | * @com_mode: communication mode: polling, Interrupt or DMA | 263 | * @com_mode: communication mode: polling, Interrupt or DMA |
270 | * @rx_lev_trig: Rx FIFO watermark level (for IT & DMA mode) | 264 | * @rx_lev_trig: Rx FIFO watermark level (for IT & DMA mode) |
271 | * @tx_lev_trig: Tx FIFO watermark level (for IT & DMA mode) | 265 | * @tx_lev_trig: Tx FIFO watermark level (for IT & DMA mode) |
266 | * @clk_phase: Motorola SPI interface Clock phase | ||
267 | * @clk_pol: Motorola SPI interface Clock polarity | ||
272 | * @ctrl_len: Microwire interface: Control length | 268 | * @ctrl_len: Microwire interface: Control length |
273 | * @wait_state: Microwire interface: Wait state | 269 | * @wait_state: Microwire interface: Wait state |
274 | * @duplex: Microwire interface: Full/Half duplex | 270 | * @duplex: Microwire interface: Full/Half duplex |
@@ -276,6 +272,8 @@ struct pl022_ssp_controller { | |||
276 | * before sampling the incoming line | 272 | * before sampling the incoming line |
277 | * @cs_control: function pointer to board-specific function to | 273 | * @cs_control: function pointer to board-specific function to |
278 | * assert/deassert I/O port to control HW generation of devices chip-select. | 274 | * assert/deassert I/O port to control HW generation of devices chip-select. |
275 | * @dma_xfer_type: Type of DMA xfer (Mem-to-periph or Periph-to-Periph) | ||
276 | * @dma_config: DMA configuration for SSP controller and peripheral | ||
279 | */ | 277 | */ |
280 | struct pl022_config_chip { | 278 | struct pl022_config_chip { |
281 | enum ssp_interface iface; | 279 | enum ssp_interface iface; |
diff --git a/include/linux/amba/pl061.h b/include/linux/amba/pl061.h index fb83c045348..5ddd9ad4b19 100644 --- a/include/linux/amba/pl061.h +++ b/include/linux/amba/pl061.h | |||
@@ -7,7 +7,8 @@ struct pl061_platform_data { | |||
7 | unsigned gpio_base; | 7 | unsigned gpio_base; |
8 | 8 | ||
9 | /* number of the first IRQ. | 9 | /* number of the first IRQ. |
10 | * If the IRQ functionality in not desired this must be set to 0. | 10 | * If the IRQ functionality in not desired this must be set to |
11 | * (unsigned) -1. | ||
11 | */ | 12 | */ |
12 | unsigned irq_base; | 13 | unsigned irq_base; |
13 | 14 | ||
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 2a5f64a11b7..e6e28f37d8e 100644 --- a/include/linux/amba/pl08x.h +++ b/include/linux/amba/pl08x.h | |||
@@ -21,9 +21,8 @@ | |||
21 | #include <linux/dmaengine.h> | 21 | #include <linux/dmaengine.h> |
22 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
23 | 23 | ||
24 | struct pl08x_lli; | ||
24 | struct pl08x_driver_data; | 25 | struct pl08x_driver_data; |
25 | struct pl08x_phy_chan; | ||
26 | struct pl08x_txd; | ||
27 | 26 | ||
28 | /* Bitmasks for selecting AHB ports for DMA transfers */ | 27 | /* Bitmasks for selecting AHB ports for DMA transfers */ |
29 | enum { | 28 | enum { |
@@ -47,29 +46,149 @@ enum { | |||
47 | * devices with static assignments | 46 | * devices with static assignments |
48 | * @muxval: a number usually used to poke into some mux regiser to | 47 | * @muxval: a number usually used to poke into some mux regiser to |
49 | * mux in the signal to this channel | 48 | * mux in the signal to this channel |
50 | * @cctl_memcpy: options for the channel control register for memcpy | 49 | * @cctl_opt: default options for the channel control register |
51 | * *** not used for slave channels *** | ||
52 | * @addr: source/target address in physical memory for this DMA channel, | 50 | * @addr: source/target address in physical memory for this DMA channel, |
53 | * can be the address of a FIFO register for burst requests for example. | 51 | * can be the address of a FIFO register for burst requests for example. |
54 | * This can be left undefined if the PrimeCell API is used for configuring | 52 | * This can be left undefined if the PrimeCell API is used for configuring |
55 | * this. | 53 | * this. |
54 | * @circular_buffer: whether the buffer passed in is circular and | ||
55 | * shall simply be looped round round (like a record baby round | ||
56 | * round round round) | ||
56 | * @single: the device connected to this channel will request single DMA | 57 | * @single: the device connected to this channel will request single DMA |
57 | * transfers, not bursts. (Bursts are default.) | 58 | * transfers, not bursts. (Bursts are default.) |
58 | * @periph_buses: the device connected to this channel is accessible via | 59 | * @periph_buses: the device connected to this channel is accessible via |
59 | * these buses (use PL08X_AHB1 | PL08X_AHB2). | 60 | * these buses (use PL08X_AHB1 | PL08X_AHB2). |
60 | */ | 61 | */ |
61 | struct pl08x_channel_data { | 62 | struct pl08x_channel_data { |
62 | const char *bus_id; | 63 | char *bus_id; |
63 | int min_signal; | 64 | int min_signal; |
64 | int max_signal; | 65 | int max_signal; |
65 | u32 muxval; | 66 | u32 muxval; |
66 | u32 cctl_memcpy; | 67 | u32 cctl; |
67 | dma_addr_t addr; | 68 | dma_addr_t addr; |
69 | bool circular_buffer; | ||
68 | bool single; | 70 | bool single; |
69 | u8 periph_buses; | 71 | u8 periph_buses; |
70 | }; | 72 | }; |
71 | 73 | ||
72 | /** | 74 | /** |
75 | * Struct pl08x_bus_data - information of source or destination | ||
76 | * busses for a transfer | ||
77 | * @addr: current address | ||
78 | * @maxwidth: the maximum width of a transfer on this bus | ||
79 | * @buswidth: the width of this bus in bytes: 1, 2 or 4 | ||
80 | * @fill_bytes: bytes required to fill to the next bus memory boundary | ||
81 | */ | ||
82 | struct pl08x_bus_data { | ||
83 | dma_addr_t addr; | ||
84 | u8 maxwidth; | ||
85 | u8 buswidth; | ||
86 | size_t fill_bytes; | ||
87 | }; | ||
88 | |||
89 | /** | ||
90 | * struct pl08x_phy_chan - holder for the physical channels | ||
91 | * @id: physical index to this channel | ||
92 | * @lock: a lock to use when altering an instance of this struct | ||
93 | * @signal: the physical signal (aka channel) serving this physical channel | ||
94 | * right now | ||
95 | * @serving: the virtual channel currently being served by this physical | ||
96 | * channel | ||
97 | */ | ||
98 | struct pl08x_phy_chan { | ||
99 | unsigned int id; | ||
100 | void __iomem *base; | ||
101 | spinlock_t lock; | ||
102 | int signal; | ||
103 | struct pl08x_dma_chan *serving; | ||
104 | }; | ||
105 | |||
106 | /** | ||
107 | * struct pl08x_txd - wrapper for struct dma_async_tx_descriptor | ||
108 | * @llis_bus: DMA memory address (physical) start for the LLIs | ||
109 | * @llis_va: virtual memory address start for the LLIs | ||
110 | */ | ||
111 | struct pl08x_txd { | ||
112 | struct dma_async_tx_descriptor tx; | ||
113 | struct list_head node; | ||
114 | enum dma_data_direction direction; | ||
115 | dma_addr_t src_addr; | ||
116 | dma_addr_t dst_addr; | ||
117 | size_t len; | ||
118 | dma_addr_t llis_bus; | ||
119 | struct pl08x_lli *llis_va; | ||
120 | /* Default cctl value for LLIs */ | ||
121 | u32 cctl; | ||
122 | /* | ||
123 | * Settings to be put into the physical channel when we | ||
124 | * trigger this txd. Other registers are in llis_va[0]. | ||
125 | */ | ||
126 | u32 ccfg; | ||
127 | }; | ||
128 | |||
129 | /** | ||
130 | * struct pl08x_dma_chan_state - holds the PL08x specific virtual channel | ||
131 | * states | ||
132 | * @PL08X_CHAN_IDLE: the channel is idle | ||
133 | * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport | ||
134 | * channel and is running a transfer on it | ||
135 | * @PL08X_CHAN_PAUSED: the channel has allocated a physical transport | ||
136 | * channel, but the transfer is currently paused | ||
137 | * @PL08X_CHAN_WAITING: the channel is waiting for a physical transport | ||
138 | * channel to become available (only pertains to memcpy channels) | ||
139 | */ | ||
140 | enum pl08x_dma_chan_state { | ||
141 | PL08X_CHAN_IDLE, | ||
142 | PL08X_CHAN_RUNNING, | ||
143 | PL08X_CHAN_PAUSED, | ||
144 | PL08X_CHAN_WAITING, | ||
145 | }; | ||
146 | |||
147 | /** | ||
148 | * struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel | ||
149 | * @chan: wrappped abstract channel | ||
150 | * @phychan: the physical channel utilized by this channel, if there is one | ||
151 | * @phychan_hold: if non-zero, hold on to the physical channel even if we | ||
152 | * have no pending entries | ||
153 | * @tasklet: tasklet scheduled by the IRQ to handle actual work etc | ||
154 | * @name: name of channel | ||
155 | * @cd: channel platform data | ||
156 | * @runtime_addr: address for RX/TX according to the runtime config | ||
157 | * @runtime_direction: current direction of this channel according to | ||
158 | * runtime config | ||
159 | * @lc: last completed transaction on this channel | ||
160 | * @pend_list: queued transactions pending on this channel | ||
161 | * @at: active transaction on this channel | ||
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 a physical | ||
167 | * channel to become available | ||
168 | */ | ||
169 | struct pl08x_dma_chan { | ||
170 | struct dma_chan chan; | ||
171 | struct pl08x_phy_chan *phychan; | ||
172 | int phychan_hold; | ||
173 | struct tasklet_struct tasklet; | ||
174 | char *name; | ||
175 | const struct pl08x_channel_data *cd; | ||
176 | dma_addr_t src_addr; | ||
177 | dma_addr_t dst_addr; | ||
178 | u32 src_cctl; | ||
179 | u32 dst_cctl; | ||
180 | enum dma_data_direction runtime_direction; | ||
181 | dma_cookie_t lc; | ||
182 | struct list_head pend_list; | ||
183 | struct pl08x_txd *at; | ||
184 | spinlock_t lock; | ||
185 | struct pl08x_driver_data *host; | ||
186 | enum pl08x_dma_chan_state state; | ||
187 | bool slave; | ||
188 | struct pl08x_txd *waiting; | ||
189 | }; | ||
190 | |||
191 | /** | ||
73 | * struct pl08x_platform_data - the platform configuration for the PL08x | 192 | * struct pl08x_platform_data - the platform configuration for the PL08x |
74 | * PrimeCells. | 193 | * PrimeCells. |
75 | * @slave_channels: the channels defined for the different devices on the | 194 | * @slave_channels: the channels defined for the different devices on the |
@@ -89,8 +208,8 @@ struct pl08x_platform_data { | |||
89 | const struct pl08x_channel_data *slave_channels; | 208 | const struct pl08x_channel_data *slave_channels; |
90 | unsigned int num_slave_channels; | 209 | unsigned int num_slave_channels; |
91 | struct pl08x_channel_data memcpy_channel; | 210 | struct pl08x_channel_data memcpy_channel; |
92 | int (*get_signal)(const struct pl08x_channel_data *); | 211 | int (*get_signal)(struct pl08x_dma_chan *); |
93 | void (*put_signal)(const struct pl08x_channel_data *, int); | 212 | void (*put_signal)(struct pl08x_dma_chan *); |
94 | u8 lli_buses; | 213 | u8 lli_buses; |
95 | u8 mem_buses; | 214 | u8 mem_buses; |
96 | }; | 215 | }; |
diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h index fe93758e840..cbee7de7dd3 100644 --- a/include/linux/amba/pl330.h +++ b/include/linux/amba/pl330.h | |||
@@ -12,7 +12,20 @@ | |||
12 | #ifndef __AMBA_PL330_H_ | 12 | #ifndef __AMBA_PL330_H_ |
13 | #define __AMBA_PL330_H_ | 13 | #define __AMBA_PL330_H_ |
14 | 14 | ||
15 | #include <linux/dmaengine.h> | 15 | #include <asm/hardware/pl330.h> |
16 | |||
17 | struct dma_pl330_peri { | ||
18 | /* | ||
19 | * Peri_Req i/f of the DMAC that is | ||
20 | * peripheral could be reached from. | ||
21 | */ | ||
22 | u8 peri_id; /* {0, 31} */ | ||
23 | enum pl330_reqtype rqtype; | ||
24 | |||
25 | /* For M->D and D->M Channels */ | ||
26 | int burst_sz; /* in power of 2 */ | ||
27 | dma_addr_t fifo_addr; | ||
28 | }; | ||
16 | 29 | ||
17 | struct dma_pl330_platdata { | 30 | struct dma_pl330_platdata { |
18 | /* | 31 | /* |
@@ -24,12 +37,9 @@ struct dma_pl330_platdata { | |||
24 | */ | 37 | */ |
25 | u8 nr_valid_peri; | 38 | u8 nr_valid_peri; |
26 | /* Array of valid peripherals */ | 39 | /* Array of valid peripherals */ |
27 | u8 *peri_id; | 40 | struct dma_pl330_peri *peri; |
28 | /* Operational capabilities */ | ||
29 | dma_cap_mask_t cap_mask; | ||
30 | /* Bytes to allocate for MC buffer */ | 41 | /* Bytes to allocate for MC buffer */ |
31 | unsigned mcbuf_sz; | 42 | unsigned mcbuf_sz; |
32 | }; | 43 | }; |
33 | 44 | ||
34 | extern bool pl330_filter(struct dma_chan *chan, void *param); | ||
35 | #endif /* __AMBA_PL330_H_ */ | 45 | #endif /* __AMBA_PL330_H_ */ |
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index f612c783170..514ed45c462 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
@@ -23,8 +23,6 @@ | |||
23 | #ifndef ASM_ARM_HARDWARE_SERIAL_AMBA_H | 23 | #ifndef ASM_ARM_HARDWARE_SERIAL_AMBA_H |
24 | #define ASM_ARM_HARDWARE_SERIAL_AMBA_H | 24 | #define ASM_ARM_HARDWARE_SERIAL_AMBA_H |
25 | 25 | ||
26 | #include <linux/types.h> | ||
27 | |||
28 | /* ------------------------------------------------------------------------------- | 26 | /* ------------------------------------------------------------------------------- |
29 | * From AMBA UART (PL010) Block Specification | 27 | * From AMBA UART (PL010) Block Specification |
30 | * ------------------------------------------------------------------------------- | 28 | * ------------------------------------------------------------------------------- |
@@ -205,6 +203,7 @@ struct amba_pl011_data { | |||
205 | void *dma_tx_param; | 203 | void *dma_tx_param; |
206 | void (*init) (void); | 204 | void (*init) (void); |
207 | void (*exit) (void); | 205 | void (*exit) (void); |
206 | void (*reset) (void); | ||
208 | }; | 207 | }; |
209 | #endif | 208 | #endif |
210 | 209 | ||