]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/amba/pl08x.h
ARM: PL08x: rename 'desc_list' as 'pend_list'
[mv-sheeva.git] / include / linux / amba / pl08x.h
index 521a0f8974ac688b20c083e1e71c410b2f26252a..08a9024e2d2f790e2f16ebcfad83ba353c65003a 100644 (file)
 #include <linux/dmaengine.h>
 #include <linux/interrupt.h>
 
+struct pl08x_lli;
+struct pl08x_driver_data;
+
+/* Bitmasks for selecting AHB ports for DMA transfers */
+enum {
+       PL08X_AHB1 = (1 << 0),
+       PL08X_AHB2 = (1 << 1)
+};
+
 /**
  * struct pl08x_channel_data - data structure to pass info between
  * platform and PL08x driver regarding channel configuration
@@ -48,6 +57,8 @@
  * round round round)
  * @single: the device connected to this channel will request single
  * DMA transfers, not bursts. (Bursts are default.)
+ * @periph_buses: the device connected to this channel is accessible via
+ * these buses (use PL08X_AHB1 | PL08X_AHB2).
  */
 struct pl08x_channel_data {
        char *bus_id;
@@ -55,10 +66,10 @@ struct pl08x_channel_data {
        int max_signal;
        u32 muxval;
        u32 cctl;
-       u32 ccfg;
        dma_addr_t addr;
        bool circular_buffer;
        bool single;
+       u8 periph_buses;
 };
 
 /**
@@ -74,7 +85,7 @@ struct pl08x_bus_data {
        dma_addr_t addr;
        u8 maxwidth;
        u8 buswidth;
-       u32 fill_bytes;
+       size_t fill_bytes;
 };
 
 /**
@@ -92,11 +103,6 @@ struct pl08x_phy_chan {
        spinlock_t lock;
        int signal;
        struct pl08x_dma_chan *serving;
-       u32 csrc;
-       u32 cdst;
-       u32 clli;
-       u32 cctl;
-       u32 ccfg;
 };
 
 /**
@@ -108,21 +114,19 @@ struct pl08x_txd {
        struct dma_async_tx_descriptor tx;
        struct list_head node;
        enum dma_data_direction direction;
-       struct pl08x_bus_data srcbus;
-       struct pl08x_bus_data dstbus;
-       int len;
+       dma_addr_t src_addr;
+       dma_addr_t dst_addr;
+       size_t len;
        dma_addr_t llis_bus;
        void *llis_va;
-       struct pl08x_channel_data *cd;
        bool active;
+       /* Default cctl value for LLIs */
+       u32 cctl;
        /*
         * Settings to be put into the physical channel when we
-        * trigger this txd
+        * trigger this txd.  Other registers are in llis_va[0].
         */
-       u32 csrc;
-       u32 cdst;
-       u32 clli;
-       u32 cctl;
+       u32 ccfg;
 };
 
 /**
@@ -154,7 +158,7 @@ enum pl08x_dma_chan_state {
  * @runtime_direction: current direction of this channel according to
  * runtime config
  * @lc: last completed transaction on this channel
- * @desc_list: queued transactions pending on this channel
+ * @pend_list: queued transactions pending on this channel
  * @at: active transaction on this channel
  * @lockflags: sometimes we let a lock last between two function calls,
  * especially prep/submit, and then we need to store the IRQ flags
@@ -174,13 +178,12 @@ struct pl08x_dma_chan {
        struct pl08x_channel_data *cd;
        dma_addr_t runtime_addr;
        enum dma_data_direction runtime_direction;
-       atomic_t last_issued;
        dma_cookie_t lc;
-       struct list_head desc_list;
+       struct list_head pend_list;
        struct pl08x_txd *at;
        unsigned long lockflags;
        spinlock_t lock;
-       void *host;
+       struct pl08x_driver_data *host;
        enum pl08x_dma_chan_state state;
        bool slave;
        struct pl08x_txd *waiting;
@@ -199,8 +202,8 @@ struct pl08x_dma_chan {
  * less than zero, else it returns the allocated signal number
  * @put_signal: indicate to the platform that this physical signal is not
  * running any DMA transfer and multiplexing can be recycled
- * @bus_bit_lli: Bit[0] of the address indicated which AHB bus master the
- * LLI addresses are on 0/1 Master 1/2.
+ * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2
+ * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2
  */
 struct pl08x_platform_data {
        struct pl08x_channel_data *slave_channels;
@@ -208,6 +211,8 @@ struct pl08x_platform_data {
        struct pl08x_channel_data memcpy_channel;
        int (*get_signal)(struct pl08x_dma_chan *);
        void (*put_signal)(struct pl08x_dma_chan *);
+       u8 lli_buses;
+       u8 mem_buses;
 };
 
 #ifdef CONFIG_AMBA_PL08X