|
@@ -42,6 +42,12 @@
|
|
|
|
|
|
#define DMA_STAT 0x30
|
|
#define DMA_STAT 0x30
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * sun8i specific registers
|
|
|
|
+ */
|
|
|
|
+#define SUN8I_DMA_GATE 0x20
|
|
|
|
+#define SUN8I_DMA_GATE_ENABLE 0x4
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Channels specific registers
|
|
* Channels specific registers
|
|
*/
|
|
*/
|
|
@@ -878,8 +884,20 @@ static struct sun6i_dma_config sun6i_a31_dma_cfg = {
|
|
.nr_max_vchans = 53,
|
|
.nr_max_vchans = 53,
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * The A23 only has 8 physical channels, a maximum DRQ port id of 24,
|
|
|
|
+ * and a total of 37 usable source and destination endpoints.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+static struct sun6i_dma_config sun8i_a23_dma_cfg = {
|
|
|
|
+ .nr_max_channels = 8,
|
|
|
|
+ .nr_max_requests = 24,
|
|
|
|
+ .nr_max_vchans = 37,
|
|
|
|
+};
|
|
|
|
+
|
|
static struct of_device_id sun6i_dma_match[] = {
|
|
static struct of_device_id sun6i_dma_match[] = {
|
|
{ .compatible = "allwinner,sun6i-a31-dma", .data = &sun6i_a31_dma_cfg },
|
|
{ .compatible = "allwinner,sun6i-a31-dma", .data = &sun6i_a31_dma_cfg },
|
|
|
|
+ { .compatible = "allwinner,sun8i-a23-dma", .data = &sun8i_a23_dma_cfg },
|
|
{ /* sentinel */ }
|
|
{ /* sentinel */ }
|
|
};
|
|
};
|
|
|
|
|
|
@@ -1007,6 +1025,15 @@ static int sun6i_dma_probe(struct platform_device *pdev)
|
|
goto err_dma_unregister;
|
|
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"))
|
|
|
|
+ writel(SUN8I_DMA_GATE_ENABLE, sdc->base + SUN8I_DMA_GATE);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
err_dma_unregister:
|
|
err_dma_unregister:
|