summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGenevieve Chan <genevieve.chan@starfivetech.com>2023-03-17 12:29:58 +0300
committerLey Foon Tan <leyfoon.tan@starfivetech.com>2023-12-04 06:00:14 +0300
commit2d1ef50744b642a93bb3cc3756511594d900813e (patch)
treed9e5f08c36bc5e1397819d49b9f819bcbe8bea90
parentb05a0cf9437c13e69e1a19742651843e3d1996b8 (diff)
downloadlinux-2d1ef50744b642a93bb3cc3756511594d900813e.tar.xz
riscv: starfive: Add DMA non-coherent support in StarFive Dubhe
This patch adds the dma non-coherent node in device tree. Sets noncoherent_supported to true for CONFIG_SOC_STARFIVE_DUBHE Signed-off-by: Genevieve Chan <genevieve.chan@starfivetech.com>
-rw-r--r--arch/riscv/boot/dts/starfive/dubhe.dtsi1
-rw-r--r--arch/riscv/mm/dma-noncoherent.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/riscv/boot/dts/starfive/dubhe.dtsi b/arch/riscv/boot/dts/starfive/dubhe.dtsi
index a0506d46134a..885164d89c10 100644
--- a/arch/riscv/boot/dts/starfive/dubhe.dtsi
+++ b/arch/riscv/boot/dts/starfive/dubhe.dtsi
@@ -61,6 +61,7 @@
#address-cells = <2>;
#size-cells = <2>;
compatible = "simple-bus";
+ dma-noncoherent;
ranges;
clint: clint@2000000 {
diff --git a/arch/riscv/mm/dma-noncoherent.c b/arch/riscv/mm/dma-noncoherent.c
index 81ee62da18a5..f8038bf019b0 100644
--- a/arch/riscv/mm/dma-noncoherent.c
+++ b/arch/riscv/mm/dma-noncoherent.c
@@ -18,6 +18,7 @@ static bool noncoherent_supported;
#ifdef CONFIG_SOC_STARFIVE_DUBHE
#define DUBHE_UNCACHED_OFFSET 0x400000000
+static bool noncoherent_supported = true;
void arch_sync_dma_for_device(phys_addr_t paddr, size_t size, enum dma_data_direction dir)
{