Skip to content
/ linux Public

Commit 6be32ba

Browse files
AngeloGioacchino Del RegnoSasha Levin
authored andcommitted
dmaengine: mediatek: uart-apdma: Fix above 4G addressing TX/RX
[ Upstream commit 58ab9d7 ] The VFF_4G_SUPPORT register is named differently in datasheets, and its name is "VFF_ADDR2"; was this named correctly from the beginning it would've been clearer that there was a mistake in the programming sequence. This register is supposed to hold the high bits to support the DMA addressing above 4G (so, more than 32 bits) and not a bit to "enable" the support for VFF 4G. Fix the name of this register, and also fix its usage by writing the upper 32 bits of the dma_addr_t on it when the SoC supports such feature. Fixes: 9135408 ("dmaengine: mediatek: Add MediaTek UART APDMA support") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://patch.msgid.link/20251113122229.23998-6-angelogioacchino.delregno@collabora.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 06c8ed2 commit 6be32ba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/dma/mediatek/mtk-uart-apdma.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#define VFF_STOP_CLR_B 0
4242
#define VFF_EN_CLR_B 0
4343
#define VFF_INT_EN_CLR_B 0
44-
#define VFF_4G_SUPPORT_CLR_B 0
44+
#define VFF_ADDR2_CLR_B 0
4545

4646
/*
4747
* interrupt trigger level for tx
@@ -72,7 +72,7 @@
7272
/* TX: the buffer size SW can write. RX: the buffer size HW can write. */
7373
#define VFF_LEFT_SIZE 0x40
7474
#define VFF_DEBUG_STATUS 0x50
75-
#define VFF_4G_SUPPORT 0x54
75+
#define VFF_ADDR2 0x54
7676

7777
struct mtk_uart_apdmadev {
7878
struct dma_device ddev;
@@ -149,7 +149,7 @@ static void mtk_uart_apdma_start_tx(struct mtk_chan *c)
149149
mtk_uart_apdma_write(c, VFF_INT_FLAG, VFF_TX_INT_CLR_B);
150150

151151
if (mtkd->support_33bits)
152-
mtk_uart_apdma_write(c, VFF_4G_SUPPORT, VFF_4G_EN_B);
152+
mtk_uart_apdma_write(c, VFF_ADDR2, upper_32_bits(d->addr));
153153
}
154154

155155
mtk_uart_apdma_write(c, VFF_EN, VFF_EN_B);
@@ -192,7 +192,7 @@ static void mtk_uart_apdma_start_rx(struct mtk_chan *c)
192192
mtk_uart_apdma_write(c, VFF_INT_FLAG, VFF_RX_INT_CLR_B);
193193

194194
if (mtkd->support_33bits)
195-
mtk_uart_apdma_write(c, VFF_4G_SUPPORT, VFF_4G_EN_B);
195+
mtk_uart_apdma_write(c, VFF_ADDR2, upper_32_bits(d->addr));
196196
}
197197

198198
mtk_uart_apdma_write(c, VFF_INT_EN, VFF_RX_INT_EN_B);
@@ -298,7 +298,7 @@ static int mtk_uart_apdma_alloc_chan_resources(struct dma_chan *chan)
298298
}
299299

300300
if (mtkd->support_33bits)
301-
mtk_uart_apdma_write(c, VFF_4G_SUPPORT, VFF_4G_SUPPORT_CLR_B);
301+
mtk_uart_apdma_write(c, VFF_ADDR2, VFF_ADDR2_CLR_B);
302302

303303
err_pm:
304304
pm_runtime_put_noidle(mtkd->ddev.dev);

0 commit comments

Comments
 (0)