Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1657564 > unrolled thread
| Started by | Icenowy Zheng <icenowy@aosc.io> |
|---|---|
| First post | 2017-06-05 14:40 +0200 |
| Last post | 2017-06-05 15:30 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/2] Allwinner V3s DMA support Icenowy Zheng <icenowy@aosc.io> - 2017-06-05 14:40 +0200
[PATCH 1/2] dmaengine: sun6i: make gate bit in sun8i's DMA engines a common quirk Icenowy Zheng <icenowy@aosc.io> - 2017-06-05 15:00 +0200
Re: [linux-sunxi] [PATCH 1/2] dmaengine: sun6i: make gate bit in sun8i's DMA engines a common quirk Chen-Yu Tsai <wens@csie.org> - 2017-06-05 15:30 +0200
| From | Icenowy Zheng <icenowy@aosc.io> |
|---|---|
| Date | 2017-06-05 14:40 +0200 |
| Subject | [PATCH 0/2] Allwinner V3s DMA support |
| Message-ID | <tOZsC-2TL-5@gated-at.bofh.it> |
This is a dedicated patchset of Allwinner V3s DMA support, which used to be part of the audio codec support patchset. It's a derivation of the DMA part of v3 of the codec patchset. Icenowy Zheng (2): dmaengine: sun6i: make gate bit in sun8i's DMA engines a common quirk dmaengine: sun6i: support V3s SoC variant .../devicetree/bindings/dma/sun6i-dma.txt | 1 + drivers/dma/sun6i-dma.c | 33 +++++++++++++++++----- 2 files changed, 27 insertions(+), 7 deletions(-) -- 2.12.2
[toc] | [next] | [standalone]
| From | Icenowy Zheng <icenowy@aosc.io> |
|---|---|
| Date | 2017-06-05 15:00 +0200 |
| Subject | [PATCH 1/2] dmaengine: sun6i: make gate bit in sun8i's DMA engines a common quirk |
| Message-ID | <tOZLY-30O-17@gated-at.bofh.it> |
| In reply to | #1657564 |
From: Icenowy Zheng <icenowy@aosc.xyz>
Originally we enable a special gate bit when the compatible indicates
A23/33.
But according to BSP sources and user manuals, more SoCs will need this
gate bit.
So make it a common quirk configured in the config struct.
Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
---
Changes since original codec patchset v3:
- Refactored comments to cover some words found in official documents.
- Removed the comments when toggling the gate bit.
drivers/dma/sun6i-dma.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index a2358780ab2c..252b59c1d1d5 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -101,6 +101,17 @@ struct sun6i_dma_config {
u32 nr_max_channels;
u32 nr_max_requests;
u32 nr_max_vchans;
+ /*
+ * In the datasheets/user manuals of newer Allwinner SoCs, a special
+ * bit (bit 2 at register 0x20) is present.
+ * It's named "DMA MCLK interface circuit auto gating bit" in the
+ * documents, and the footnote of this register says that this bit
+ * should be set up when initializing the DMA controller.
+ * Allwinner A23/A33 user manuals do not have this bit documented,
+ * however these SoCs really have and need this bit, as seen in the
+ * BSP kernel source code.
+ */
+ bool gate_needed;
};
/*
@@ -1009,6 +1020,7 @@ static struct sun6i_dma_config sun8i_a23_dma_cfg = {
.nr_max_channels = 8,
.nr_max_requests = 24,
.nr_max_vchans = 37,
+ .gate_needed = true,
};
static struct sun6i_dma_config sun8i_a83t_dma_cfg = {
@@ -1174,13 +1186,7 @@ static int sun6i_dma_probe(struct platform_device *pdev)
goto err_dma_unregister;
}
- /*
- * sun8i variant requires us to toggle a dma gating register,
- * as seen in Allwinner's SDK. This register is not documented
- * in the A23 user manual.
- */
- if (of_device_is_compatible(pdev->dev.of_node,
- "allwinner,sun8i-a23-dma"))
+ if (sdc->cfg->gate_needed)
writel(SUN8I_DMA_GATE_ENABLE, sdc->base + SUN8I_DMA_GATE);
return 0;
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Chen-Yu Tsai <wens@csie.org> |
|---|---|
| Date | 2017-06-05 15:30 +0200 |
| Subject | Re: [linux-sunxi] [PATCH 1/2] dmaengine: sun6i: make gate bit in sun8i's DMA engines a common quirk |
| Message-ID | <tP0f0-3pX-19@gated-at.bofh.it> |
| In reply to | #1657575 |
On Mon, Jun 5, 2017 at 8:33 PM, Icenowy Zheng <icenowy@aosc.io> wrote: > From: Icenowy Zheng <icenowy@aosc.xyz> > > Originally we enable a special gate bit when the compatible indicates > A23/33. > > But according to BSP sources and user manuals, more SoCs will need this > gate bit. > > So make it a common quirk configured in the config struct. > > Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Reviewed-by: Chen-Yu Tsai <wens@csie.org>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web