Unified · Split
| @@ -106,6 +106,7 @@ struct pl08x_driver_data; · 105 unmodified lines | ||
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | 108 | * struct vendor_data - vendor-specific config parameters for PL08x derivatives |
| 109 | + * @config_offset: offset to the configuration register | |
| 109 | 110 | * @channels: the number of channels available in this variant |
| 110 | 111 | * @signals: the number of request signals available from the hardware |
| 111 | 112 | * @dualmaster: whether this version supports dual AHB masters or not. |
| @@ -145,6 +146,8 @@ struct pl08x_bus_data { · 33 unmodified lines | ||
| 145 | 146 | /** |
| 146 | 147 | * struct pl08x_phy_chan - holder for the physical channels |
| 147 | 148 | * @id: physical index to this channel |
| 149 | + * @base: memory base address for this physical channel | |
| 150 | + * @reg_config: configuration address for this physical channel | |
| 148 | 151 | * @lock: a lock to use when altering an instance of this struct |
| 149 | 152 | * @serving: the virtual channel currently being served by this physical |
| 150 | 153 | * channel |
| @@ -203,7 +206,7 @@ struct pl08x_txd { · 52 unmodified lines | ||
| 203 | 206 | }; |
| 204 | 207 | |
| 205 | 208 | /** |
| 206 | − * struct pl08x_dma_chan_state - holds the PL08x specific virtual channel | |
| 209 | + * enum pl08x_dma_chan_state - holds the PL08x specific virtual channel | |
| 207 | 210 | * states |
| 208 | 211 | * @PL08X_CHAN_IDLE: the channel is idle |
| 209 | 212 | * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport |
| @@ -226,9 +229,8 @@ enum pl08x_dma_chan_state { · 16 unmodified lines | ||
| 226 | 229 | * @phychan: the physical channel utilized by this channel, if there is one |
| 227 | 230 | * @name: name of channel |
| 228 | 231 | * @cd: channel platform data |
| 229 | − * @runtime_addr: address for RX/TX according to the runtime config | |
| 232 | + * @cfg: slave configuration | |
| 230 | 233 | * @at: active transaction on this channel |
| 231 | − * @lock: a lock for this channel data | |
| 232 | 234 | * @host: a pointer to the host (internal use) |
| 233 | 235 | * @state: whether the channel is idle, paused, running etc |
| 234 | 236 | * @slave: whether this channel is a device (slave) or for memcpy |
| @@ -262,7 +264,7 @@ struct pl08x_dma_chan { · 27 unmodified lines | ||
| 262 | 264 | * @lli_buses: bitmask to or in to LLI pointer selecting AHB port for LLI |
| 263 | 265 | * fetches |
| 264 | 266 | * @mem_buses: set to indicate memory transfers on AHB2. |
| 265 | − * @lock: a spinlock for this struct | |
| 267 | + * @lli_words: how many words are used in each LLI item for this variant | |
| 266 | 268 | */ |
| 267 | 269 | struct pl08x_driver_data { |
| 268 | 270 | struct dma_device slave; |
| @@ -417,7 +419,7 @@ static void pl08x_start_next_txd(struct pl08x_dma_chan *plchan) · 148 unmodified lines | ||
| 417 | 419 | |
| 418 | 420 | /* Enable the DMA channel */ |
| 419 | 421 | /* Do not access config register until channel shows as disabled */ |
| 420 | − while (readl(pl08x->base + PL080_EN_CHAN) & (1 << phychan->id)) | |
| 422 | + while (readl(pl08x->base + PL080_EN_CHAN) & BIT(phychan->id)) | |
| 421 | 423 | cpu_relax(); |
| 422 | 424 | |
| 423 | 425 | /* Do not access config register until channel shows as inactive */ |
| @@ -484,8 +486,8 @@ static void pl08x_terminate_phy_chan(struct pl08x_driver_data *pl08x, · 60 unmodified lines | ||
| 484 | 486 | |
| 485 | 487 | writel(val, ch->reg_config); |
| 486 | 488 | |
| 487 | − writel(1 << ch->id, pl08x->base + PL080_ERR_CLEAR); | |
| 488 | − writel(1 << ch->id, pl08x->base + PL080_TC_CLEAR); | |
| 489 | + writel(BIT(ch->id), pl08x->base + PL080_ERR_CLEAR); | |
| 490 | + writel(BIT(ch->id), pl08x->base + PL080_TC_CLEAR); | |
| 489 | 491 | } |
| 490 | 492 | |
| 491 | 493 | static inline u32 get_bytes_in_cctl(u32 cctl) |
| @@ -1834,7 +1836,7 @@ static irqreturn_t pl08x_irq(int irq, void *dev) · 1342 unmodified lines | ||
| 1834 | 1836 | return IRQ_NONE; |
| 1835 | 1837 | |
| 1836 | 1838 | for (i = 0; i < pl08x->vd->channels; i++) { |
| 1837 | − if (((1 << i) & err) || ((1 << i) & tc)) { | |
| 1839 | + if ((BIT(i) & err) || (BIT(i) & tc)) { | |
| 1838 | 1840 | /* Locate physical channel */ |
| 1839 | 1841 | struct pl08x_phy_chan *phychan = &pl08x->phy_chans[i]; |
| 1840 | 1842 | struct pl08x_dma_chan *plchan = phychan->serving; |
| @@ -1872,7 +1874,7 @@ static irqreturn_t pl08x_irq(int irq, void *dev) · 31 unmodified lines | ||
| 1872 | 1874 | } |
| 1873 | 1875 | spin_unlock(&plchan->vc.lock); |
| 1874 | 1876 | |
| 1875 | − mask |= (1 << i); | |
| 1877 | + mask |= BIT(i); | |
| 1876 | 1878 | } |
| 1877 | 1879 | } |
| 1878 | 1880 | |
| @@ -38,24 +38,16 @@ · 37 unmodified lines | ||
| 38 | 38 | #define PL080_SOFT_LSREQ (0x2C) |
| 39 | 39 | |
| 40 | 40 | #define PL080_CONFIG (0x30) |
| 41 | −#define PL080_CONFIG_M2_BE (1 << 2) | |
| 42 | −#define PL080_CONFIG_M1_BE (1 << 1) | |
| 43 | −#define PL080_CONFIG_ENABLE (1 << 0) | |
| 41 | +#define PL080_CONFIG_M2_BE BIT(2) | |
| 42 | +#define PL080_CONFIG_M1_BE BIT(1) | |
| 43 | +#define PL080_CONFIG_ENABLE BIT(0) | |
| 44 | 44 | |
| 45 | 45 | #define PL080_SYNC (0x34) |
| 46 | 46 | |
| 47 | 47 | /* Per channel configuration registers */ |
| 48 | 48 | |
| 49 | −#define PL080_Cx_STRIDE (0x20) | |
| 49 | +/* Per channel configuration registers */ | |
| 50 | 50 | #define PL080_Cx_BASE(x) ((0x100 + (x * 0x20))) |
| 51 | −#define PL080_Cx_SRC_ADDR(x) ((0x100 + (x * 0x20))) | |
| 52 | −#define PL080_Cx_DST_ADDR(x) ((0x104 + (x * 0x20))) | |
| 53 | −#define PL080_Cx_LLI(x) ((0x108 + (x * 0x20))) | |
| 54 | −#define PL080_Cx_CONTROL(x) ((0x10C + (x * 0x20))) | |
| 55 | −#define PL080_Cx_CONFIG(x) ((0x110 + (x * 0x20))) | |
| 56 | −#define PL080S_Cx_CONTROL2(x) ((0x110 + (x * 0x20))) | |
| 57 | −#define PL080S_Cx_CONFIG(x) ((0x114 + (x * 0x20))) | |
| 58 | − | |
| 59 | 51 | #define PL080_CH_SRC_ADDR (0x00) |
| 60 | 52 | #define PL080_CH_DST_ADDR (0x04) |
| 61 | 53 | #define PL080_CH_LLI (0x08) |
| @@ -66,18 +58,18 @@ · 4 unmodified lines | ||
| 66 | 58 | |
| 67 | 59 | #define PL080_LLI_ADDR_MASK (0x3fffffff << 2) |
| 68 | 60 | #define PL080_LLI_ADDR_SHIFT (2) |
| 69 | −#define PL080_LLI_LM_AHB2 (1 << 0) | |
| 61 | +#define PL080_LLI_LM_AHB2 BIT(0) | |
| 70 | 62 | |
| 71 | −#define PL080_CONTROL_TC_IRQ_EN (1 << 31) | |
| 63 | +#define PL080_CONTROL_TC_IRQ_EN BIT(31) | |
| 72 | 64 | #define PL080_CONTROL_PROT_MASK (0x7 << 28) |
| 73 | 65 | #define PL080_CONTROL_PROT_SHIFT (28) |
| 74 | −#define PL080_CONTROL_PROT_CACHE (1 << 30) | |
| 75 | −#define PL080_CONTROL_PROT_BUFF (1 << 29) | |
| 76 | −#define PL080_CONTROL_PROT_SYS (1 << 28) | |
| 77 | −#define PL080_CONTROL_DST_INCR (1 << 27) | |
| 78 | −#define PL080_CONTROL_SRC_INCR (1 << 26) | |
| 79 | −#define PL080_CONTROL_DST_AHB2 (1 << 25) | |
| 80 | −#define PL080_CONTROL_SRC_AHB2 (1 << 24) | |
| 66 | +#define PL080_CONTROL_PROT_CACHE BIT(30) | |
| 67 | +#define PL080_CONTROL_PROT_BUFF BIT(29) | |
| 68 | +#define PL080_CONTROL_PROT_SYS BIT(28) | |
| 69 | +#define PL080_CONTROL_DST_INCR BIT(27) | |
| 70 | +#define PL080_CONTROL_SRC_INCR BIT(26) | |
| 71 | +#define PL080_CONTROL_DST_AHB2 BIT(25) | |
| 72 | +#define PL080_CONTROL_SRC_AHB2 BIT(24) | |
| 81 | 73 | #define PL080_CONTROL_DWIDTH_MASK (0x7 << 21) |
| 82 | 74 | #define PL080_CONTROL_DWIDTH_SHIFT (21) |
| 83 | 75 | #define PL080_CONTROL_SWIDTH_MASK (0x7 << 18) |
| @@ -103,20 +95,20 @@ · 19 unmodified lines | ||
| 103 | 95 | #define PL080_WIDTH_16BIT (0x1) |
| 104 | 96 | #define PL080_WIDTH_32BIT (0x2) |
| 105 | 97 | |
| 106 | −#define PL080N_CONFIG_ITPROT (1 << 20) | |
| 107 | −#define PL080N_CONFIG_SECPROT (1 << 19) | |
| 108 | −#define PL080_CONFIG_HALT (1 << 18) | |
| 109 | −#define PL080_CONFIG_ACTIVE (1 << 17) /* RO */ | |
| 110 | −#define PL080_CONFIG_LOCK (1 << 16) | |
| 111 | −#define PL080_CONFIG_TC_IRQ_MASK (1 << 15) | |
| 112 | −#define PL080_CONFIG_ERR_IRQ_MASK (1 << 14) | |
| 98 | +#define PL080N_CONFIG_ITPROT BIT(20) | |
| 99 | +#define PL080N_CONFIG_SECPROT BIT(19) | |
| 100 | +#define PL080_CONFIG_HALT BIT(18) | |
| 101 | +#define PL080_CONFIG_ACTIVE BIT(17) /* RO */ | |
| 102 | +#define PL080_CONFIG_LOCK BIT(16) | |
| 103 | +#define PL080_CONFIG_TC_IRQ_MASK BIT(15) | |
| 104 | +#define PL080_CONFIG_ERR_IRQ_MASK BIT(14) | |
| 113 | 105 | #define PL080_CONFIG_FLOW_CONTROL_MASK (0x7 << 11) |
| 114 | 106 | #define PL080_CONFIG_FLOW_CONTROL_SHIFT (11) |
| 115 | 107 | #define PL080_CONFIG_DST_SEL_MASK (0xf << 6) |
| 116 | 108 | #define PL080_CONFIG_DST_SEL_SHIFT (6) |
| 117 | 109 | #define PL080_CONFIG_SRC_SEL_MASK (0xf << 1) |
| 118 | 110 | #define PL080_CONFIG_SRC_SEL_SHIFT (1) |
| 119 | −#define PL080_CONFIG_ENABLE (1 << 0) | |
| 111 | +#define PL080_CONFIG_ENABLE BIT(0) | |
| 120 | 112 | |
| 121 | 113 | #define PL080_FLOW_MEM2MEM (0x0) |
| 122 | 114 | #define PL080_FLOW_MEM2PER (0x1) |