Skip to content

Commit 0a99b56

Browse files
esmilConchuOD
authored andcommitted
riscv: dts: starfive: Add pool for coherent DMA memory on JH7100 boards
The StarFive JH7100 SoC has non-coherent device DMAs, but most drivers expect to be able to allocate coherent memory for DMA descriptors and such. However on the JH7100 DDR memory appears twice in the physical memory map, once cached and once uncached: 0x00_8000_0000 - 0x08_7fff_ffff : Off chip DDR memory, cached 0x10_0000_0000 - 0x17_ffff_ffff : Off chip DDR memory, uncached To use this uncached region we create a global DMA memory pool there and reserve the corresponding area in the cached region. However the uncached region is fully above the 32bit address limit, so add a dma-ranges map so the DMA address used for peripherals is still in the regular cached region below the limit. Link: https://github.com/starfive-tech/JH7100_Docs/blob/main/JH7100%20Data%20Sheet%20V01.01.04-EN%20(4-21-2021).pdf Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
1 parent d4b95c4 commit 0a99b56

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

arch/riscv/boot/dts/starfive/jh7100-common.dtsi

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,30 @@
3939
label = "ack";
4040
};
4141
};
42+
43+
reserved-memory {
44+
#address-cells = <2>;
45+
#size-cells = <2>;
46+
ranges;
47+
48+
dma-reserved@fa000000 {
49+
reg = <0x0 0xfa000000 0x0 0x1000000>;
50+
no-map;
51+
};
52+
53+
linux,dma@107a000000 {
54+
compatible = "shared-dma-pool";
55+
reg = <0x10 0x7a000000 0x0 0x1000000>;
56+
no-map;
57+
linux,dma-default;
58+
};
59+
};
60+
61+
soc {
62+
dma-ranges = <0x00 0x80000000 0x00 0x80000000 0x00 0x7a000000>,
63+
<0x00 0xfa000000 0x10 0x7a000000 0x00 0x01000000>,
64+
<0x00 0xfb000000 0x00 0xfb000000 0x07 0x85000000>;
65+
};
4266
};
4367

4468
&gpio {

0 commit comments

Comments
 (0)