| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 3 | | - * under the terms of the GNU General Public License version 2 as published |
|---|
| 4 | | - * by the Free Software Foundation. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 7 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 8 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 9 | | - * GNU General Public License for more details. |
|---|
| 10 | | - * |
|---|
| 11 | | - * You should have received a copy of the GNU General Public License |
|---|
| 12 | | - * along with this program; if not, write to the Free Software |
|---|
| 13 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 14 | 3 | * |
|---|
| 15 | 4 | * Copyright (C) 2011 John Crispin <john@phrozen.org> |
|---|
| 16 | 5 | */ |
|---|
| .. | .. |
|---|
| 51 | 40 | #define DMA_IRQ_ACK 0x7e /* IRQ status register */ |
|---|
| 52 | 41 | #define DMA_POLL BIT(31) /* turn on channel polling */ |
|---|
| 53 | 42 | #define DMA_CLK_DIV4 BIT(6) /* polling clock divider */ |
|---|
| 54 | | -#define DMA_2W_BURST BIT(1) /* 2 word burst length */ |
|---|
| 43 | +#define DMA_PCTRL_2W_BURST 0x1 /* 2 word burst length */ |
|---|
| 44 | +#define DMA_PCTRL_4W_BURST 0x2 /* 4 word burst length */ |
|---|
| 45 | +#define DMA_PCTRL_8W_BURST 0x3 /* 8 word burst length */ |
|---|
| 46 | +#define DMA_TX_BURST_SHIFT 4 /* tx burst shift */ |
|---|
| 47 | +#define DMA_RX_BURST_SHIFT 2 /* rx burst shift */ |
|---|
| 55 | 48 | #define DMA_ETOP_ENDIANNESS (0xf << 8) /* endianness swap etop channels */ |
|---|
| 56 | 49 | #define DMA_WEIGHT (BIT(17) | BIT(16)) /* default channel wheight */ |
|---|
| 57 | 50 | |
|---|
| .. | .. |
|---|
| 107 | 100 | spin_lock_irqsave(<q_dma_lock, flag); |
|---|
| 108 | 101 | ltq_dma_w32(ch->nr, LTQ_DMA_CS); |
|---|
| 109 | 102 | ltq_dma_w32_mask(0, DMA_CHAN_ON, LTQ_DMA_CCTRL); |
|---|
| 110 | | - ltq_dma_w32_mask(0, 1 << ch->nr, LTQ_DMA_IRNEN); |
|---|
| 111 | 103 | spin_unlock_irqrestore(<q_dma_lock, flag); |
|---|
| 112 | 104 | } |
|---|
| 113 | 105 | EXPORT_SYMBOL_GPL(ltq_dma_open); |
|---|
| .. | .. |
|---|
| 131 | 123 | unsigned long flags; |
|---|
| 132 | 124 | |
|---|
| 133 | 125 | ch->desc = 0; |
|---|
| 134 | | - ch->desc_base = dma_zalloc_coherent(ch->dev, |
|---|
| 135 | | - LTQ_DESC_NUM * LTQ_DESC_SIZE, |
|---|
| 136 | | - &ch->phys, GFP_ATOMIC); |
|---|
| 126 | + ch->desc_base = dma_alloc_coherent(ch->dev, |
|---|
| 127 | + LTQ_DESC_NUM * LTQ_DESC_SIZE, |
|---|
| 128 | + &ch->phys, GFP_ATOMIC); |
|---|
| 137 | 129 | |
|---|
| 138 | 130 | spin_lock_irqsave(<q_dma_lock, flags); |
|---|
| 139 | 131 | ltq_dma_w32(ch->nr, LTQ_DMA_CS); |
|---|
| .. | .. |
|---|
| 203 | 195 | break; |
|---|
| 204 | 196 | |
|---|
| 205 | 197 | case DMA_PORT_DEU: |
|---|
| 206 | | - ltq_dma_w32((DMA_2W_BURST << 4) | (DMA_2W_BURST << 2), |
|---|
| 198 | + ltq_dma_w32((DMA_PCTRL_2W_BURST << DMA_TX_BURST_SHIFT) | |
|---|
| 199 | + (DMA_PCTRL_2W_BURST << DMA_RX_BURST_SHIFT), |
|---|
| 207 | 200 | LTQ_DMA_PCTRL); |
|---|
| 208 | 201 | break; |
|---|
| 209 | 202 | |
|---|