Registered User mNo edit summary Tag: 2017 source edit |
Registered User Tag: 2017 source edit |
||
Line 13: | Line 13: | ||
== DT bindings documentation == | == DT bindings documentation == | ||
Complete device tree bindings can be found at this location: <ref>{{CodeSource | Linux kernel | Documentation/devicetree/bindings/dma/st,stm32-dma3.yaml}}</ref> | Complete device tree bindings can be found at this location: <ref>{{CodeSource | Linux kernel | Documentation/devicetree/bindings/dma/stm32/st,stm32-dma3.yaml}}</ref> | ||
== DT configuration == | == DT configuration == |
Revision as of 14:51, 4 June 2024
1. Article purpose
This article explains how to configure the HPDMA internal peripheral when it is assigned to the Linux® OS. In that case, it is controlled by the DMA Engine (Refer to Dmaengine overview).
The configuration is performed using the Device tree mechanism that provides a hardware description of the HPDMA internal peripheral, used by the STM32 DMA3 Linux driver and by the DMA framework.
Hardware description is a combination of:
- STM32 HPDMA peripheral,
- STM32 HPDMA client.
2. DT bindings documentation
Complete device tree bindings can be found at this location: [1]
3. DT configuration
This hardware description is a combination of the STM32 microprocessor device tree files (.dtsi extension) and board device tree files (.dts extension). See the Device tree for an explanation of the device tree file split.
STM32CubeMX can be used to generate the board device tree. Refer to How to configure the DT using STM32CubeMX for more details.
3.1. DT configuration (STM32 level)
The STM32MP2 HPDMA node for STM32MP25x lines is located in stm32mp251.dtsi[2]
For example, at device level, the HPDMA is declared as follows:
hpdma: dma-controller@40400000 {
compatible = "st,stm32-dma3";
reg = <0x40400000 0x1000>;
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&scmi_clk CK_SCMI_HPDMA1>;
power-domains = <&RET_PD>;
#dma-cells = <4>;
st,axi-max-burst-len = <16>;
};
3.2. DT configuration (board level)
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
[...]
hpdma1_lli: hpdma1-lli@a020000 {
reg = <0x0 0xa020000 0x0 0xf0f0>;
no-map;
};
[...]
};
&hpdma {
memory-region = <&hpdma1_lli>;
};
Board device tree configuration can be used to specify memory-region property pointing on reserved memory used for HPDMA internal descriptors.
4. How to configure the DT using STM32CubeMX
The STM32CubeMX tool can be used to configure the STM32MPU device and get the corresponding platform configuration device tree files.
The STM32CubeMX may not support all the properties described in the above DT bindings documentation paragraph. If so, the tool inserts user sections in the generated device tree. These sections can then be edited to add some properties and they are preserved from one generation to another. Refer to STM32CubeMX user manual for further information.
5. References
Please refer to the following links for additional information: