Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Documentation/devicetree/bindings/dma/spacemit,k1-pdma.yaml
Comment thread
unicornx marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/dma/spacemit,k1-pdma.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: SpacemiT K1 PDMA Controller

maintainers:
- Guodong Xu <guodong@riscstar.com>

allOf:
- $ref: dma-controller.yaml#

properties:
compatible:
enum:
- spacemit,k1-pdma
- spacemit,k3-pdma

reg:
maxItems: 1

interrupts:
description: Shared interrupt for all DMA channels
maxItems: 1

clocks:
maxItems: 1

resets:
maxItems: 1

dma-channels:
maximum: 16

'#dma-cells':
const: 1
description:
The DMA request number for the peripheral device.

required:
- compatible
- reg
- interrupts
- clocks
- resets
- dma-channels
- '#dma-cells'

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/clock/spacemit,k1-syscon.h>

soc {
#address-cells = <2>;
#size-cells = <2>;

dma-controller@d4000000 {
compatible = "spacemit,k1-pdma";
reg = <0x0 0xd4000000 0x0 0x4000>;
interrupts = <72>;
clocks = <&syscon_apmu CLK_DMA>;
resets = <&syscon_apmu RESET_DMA>;
dma-channels = <16>;
#dma-cells = <1>;
};
};
12 changes: 12 additions & 0 deletions arch/riscv/boot/dts/spacemit/k3.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,18 @@
#reset-cells = <1>;
};

pdma: dma-controller@d4000000 {
compatible = "spacemit,k3-pdma";
reg = <0x0 0xd4000000 0x0 0x4000>;
clocks = <&syscon_apmu CLK_APMU_DMA>;
resets = <&syscon_apmu RESET_APMU_DMA>;
interrupt-parent = <&saplic>;
interrupts = <72 IRQ_TYPE_LEVEL_HIGH>;
dma-channels = <16>;
#dma-cells = <1>;
status = "disabled";
};

uart0: serial@d4017000 {
compatible = "spacemit,k1-uart",
"intel,xscale-uart";
Expand Down
1 change: 1 addition & 0 deletions arch/riscv/configs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2179,6 +2179,7 @@ CONFIG_RTC_DRV_POLARFIRE_SOC=m
CONFIG_DMADEVICES=y
CONFIG_DMA_SUN6I=m
CONFIG_DW_AXI_DMAC=m
CONFIG_MMP_PDMA=m
CONFIG_ASYNC_TX_DMA=y
CONFIG_DMATEST=y
CONFIG_UIO_CIF=m
Expand Down
2 changes: 0 additions & 2 deletions arch/riscv/configs/k1_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ CONFIG_RESET_K1_SPACEMIT=y
CONFIG_PINCTRL_SPACEMIT_K1=y
CONFIG_GPIO_K1=y
CONFIG_SPACEMIT_MEM_RANGE=y
CONFIG_SPACEMIT_K1_DMA=y
CONFIG_I2C_SPACEMIT_K1=y
CONFIG_SPI_SPACEMIT_K1=y
CONFIG_SPI_SPACEMIT_K1_QSPI=y
Expand All @@ -24,4 +23,3 @@ CONFIG_SPACEMIT_P1_ADC=m
CONFIG_MMC_SDHCI_OF_K1=y
CONFIG_NET_VENDOR_SPACEMIT=y
CONFIG_K1_EMAC=m

9 changes: 1 addition & 8 deletions drivers/dma/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ config MILBEAUT_XDMAC

config MMP_PDMA
tristate "MMP PDMA support"
depends on ARCH_MMP || ARCH_PXA || COMPILE_TEST
depends on ARCH_MMP || ARCH_PXA || ARCH_SPACEMIT || COMPILE_TEST
select DMA_ENGINE
help
Support the MMP PDMA engine for PXA and MMP platform.
Expand Down Expand Up @@ -489,13 +489,6 @@ config OWL_DMA
help
Enable support for the Actions Semi Owl SoCs DMA controller.

config SPACEMIT_K1_DMA
bool "Spacemit k1 SoCs DMA support"
depends on SOC_SPACEMIT_K1
depends on DMA_ENGINE
help
Enable support for the Spacemit k1 SoCs DMA controller.

config PCH_DMA
tristate "Intel EG20T PCH / LAPIS Semicon IOH(ML7213/ML7223/ML7831) DMA"
depends on PCI && (X86_32 || COMPILE_TEST)
Expand Down
1 change: 0 additions & 1 deletion drivers/dma/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ obj-$(CONFIG_PPC_BESTCOMM) += bestcomm/
obj-$(CONFIG_PXA_DMA) += pxa_dma.o
obj-$(CONFIG_RENESAS_DMA) += sh/
obj-$(CONFIG_SF_PDMA) += sf-pdma/
obj-$(CONFIG_SPACEMIT_K1_DMA) += spacemit-k1-dma.o
obj-$(CONFIG_STE_DMA40) += ste_dma40.o ste_dma40_ll.o
obj-$(CONFIG_STM32_DMA) += stm32-dma.o
obj-$(CONFIG_STM32_DMAMUX) += stm32-dmamux.o
Expand Down
25 changes: 10 additions & 15 deletions drivers/dma/k3dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/clk.h>
#include <linux/of_dma.h>
Expand Down Expand Up @@ -839,7 +838,6 @@ static int k3_dma_probe(struct platform_device *op)
{
const struct k3dma_soc_data *soc_data;
struct k3_dma_dev *d;
const struct of_device_id *of_id;
int i, ret, irq = 0;

d = devm_kzalloc(&op->dev, sizeof(*d), GFP_KERNEL);
Expand All @@ -854,19 +852,16 @@ static int k3_dma_probe(struct platform_device *op)
if (IS_ERR(d->base))
return PTR_ERR(d->base);

of_id = of_match_device(k3_pdma_dt_ids, &op->dev);
if (of_id) {
of_property_read_u32((&op->dev)->of_node,
"dma-channels", &d->dma_channels);
of_property_read_u32((&op->dev)->of_node,
"dma-requests", &d->dma_requests);
ret = of_property_read_u32((&op->dev)->of_node,
"dma-channel-mask", &d->dma_channel_mask);
if (ret) {
dev_warn(&op->dev,
"dma-channel-mask doesn't exist, considering all as available.\n");
d->dma_channel_mask = (u32)~0UL;
}
of_property_read_u32((&op->dev)->of_node,
"dma-channels", &d->dma_channels);
of_property_read_u32((&op->dev)->of_node,
"dma-requests", &d->dma_requests);
ret = of_property_read_u32((&op->dev)->of_node,
"dma-channel-mask", &d->dma_channel_mask);
if (ret) {
dev_warn(&op->dev,
"dma-channel-mask doesn't exist, considering all as available.\n");
d->dma_channel_mask = (u32)~0UL;
}

if (!(soc_data->flags & K3_FLAG_NOCLK)) {
Expand Down
Loading
Loading