Difference between revisions of "HDP device tree configuration"

[unchecked revision] [quality revision]
m
(Merge articles)
Applicable for STM32MP13x lines, STM32MP15x lines

1 Article purpose[edit]

This article explains how to configure the HDP driver when the peripheral is assigned to the Linux® OS.

The configuration is performed using the device tree mechanism, which provides a hardware description of the Ethernet peripheral used by STM32 HDP driver

2 DT bindings documentation[edit]

The HDP tree bindings are composed of:

  • STM32 HDP device tree bindings [1]

3 DT configuration[edit]

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)[edit]

The STM32MP1 HDP node is located

  • for STM32MP13x lines Warning.png in stm32mp131.dtsi [2]
  • for STM32MP15x lines More info.png in stm32mp151.dtsi [3]

see Device tree for further explanation.


Warning white.png Warning
This device tree part is related to STM32 microprocessors. It must be kept as is, without being modified by the end user.

see Device tree for further explanation. For example:

hdp: hdp@5002a000 {
	compatible = "st,stm32mp1-hdp";
	reg = <0x5002a000 0x400>;
	clocks = <&rcc HDP>;
	clock-names = "hdp";
	status = "disabled";
};

The required and optional properties are fully described in the bindings files.

3.2 HDP DT configuration (board level)[edit]

Part of the device tree describes the HDP hardware used on a given board. The DT node ("hdp") must be filled in as follows:

  • Enable the HDP block by setting status = "okay".
  • Configure the pins in use via pinctrl, through pinctrl-0 (default pins), pinctrl-1 (sleep pins) and pinctrl-names.
  • Configure the HDP interface using muxing-hdp to indicate which one of the 16 possible output pins is assigned to each HDP output.
&hdp {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&hdpx_pins_y>;
	pinctrl-1 = <&hdpx_pins_sleep_y>;
	status = "disabled";

	muxing-hdp = <(STM32_HDP(x, HDPx_value))>;
};

3.3 DT configuration examples[edit]

The example below shows how to configure and enable HDP instances at board level:

&hdp {
   pinctrl-names = "default", "sleep";                                    
   pinctrl-0 = <&hdp0_pins_a &hdp6_pins_a &hdp7_pins_a>;                  /* configure pinctrl for hdp pin 0, 6 and 7*/
   pinctrl-1 = <&hdp0_pins_sleep_a &hdp6_pins_sleep_a &hdp7_pins_sleep_a>;
   status = "okay";                                                       /* enable HDP */ 
   
   muxing-hdp = <(STM32_HDP(0, HDP0_GPOVAL_0) |                           /* For HDP pin 0, the signal HDP0_GPOVAL_0 is selected*/
                   STM32_HDP(6, HDP6_GPOVAL_6) |                          /* For HDP pin 6, the signal HDP0_GPOVAL_6 is selected*/
                   STM32_HDP(7, HDP7_GPOVAL_7))>;                         /* For HDP pin 7, the signal HDP0_GPOVAL_7 is selected*/
};

List of all possible STM32MP1 HDP signals are located

  • for STM32MP13x lines Warning.png in stm32mp13-hdp.h [4]
  • for STM32MP15x lines More info.png in stm32-hdp.h [5]

4 How to configure the DT using STM32CubeMX[edit]

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[edit]


<noinclude>{{ApplicableFor
|MPUs list=STM32MP13x, STM32MP15x
|MPUs checklist=STM32MP13x,STM32MP15x
}}</noinclude>

== Article purpose ==
This article explains how to configure the [[HDP Linux driver|HDP driver]] when the peripheral is assigned to the Linux<sup>&reg;</sup> OS'''. 

The configuration is performed using the [[Device tree|device tree]] mechanism, which provides a hardware description of the Ethernet peripheral used by STM32 HDP driver

== DT bindings documentation ==
The ''HDP'' tree bindings are composed of:
* STM32 HDP device tree bindings <ref>{{CodeSource | Linux kernel | Documentation/devicetree/bindings/soc/stm32/stm32_hdp.txt | Documentation/devicetree/bindings/soc/stm32/stm32_hdp.txt}}</ref>


== 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|How to configure the DT using STM32CubeMX]] for more details.

=== DT configuration (STM32 level) ===
The STM32MP1 [[HDP internal peripheral| HDP ]] node is located
* for {{MicroprocessorDevice | device=13}}  in  stm32mp131.dtsi <ref name="stm32mp131.dtsi">{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp131.dtsi | stm32mp131.dtsi}}</ref>

* for {{MicroprocessorDevice | device=15}}  in stm32mp151.dtsi <ref name="stm32mp151.dtsi">{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp151.dtsi | stm32mp151.dtsi}}</ref>

see [[Device tree]] for further explanation.

{{Warning|This device tree part is related to STM32 microprocessors. It must be kept as is, without being modified by the end user.}}
see [[Device tree]] for further explanation.For example: 
<pre>

hdp: hdp@5002a000 {
	compatible = "st,stm32mp1-hdp";
	reg = <0x5002a000 0x400>;
	clocks = <&rcc HDP>;
	clock-names = "hdp";
	status = "disabled";
};</pre>


The required and optional properties are fully described in the [[HDP device tree configuration#DT bindings documentation|bindings files]].

=== HDP DT configuration (board level) ===

Part of the [[Device tree|device tree]] describes the HDP hardware used on a given board. The DT node ('''"hdp"''') must be filled in as follows:
* Enable the HDP block by setting '''status = "okay".'''
* Configure the pins in use via [[Pinctrl overview|pinctrl]], through '''pinctrl-0''' (default pins), '''pinctrl-1''' (sleep pins) and '''pinctrl-names'''.
* Configure the HDP interface using '''muxing-hdp''' to indicate which one of the 16 possible output pins is assigned to each HDP output.<pre>

&hdp {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&hdpx_pins_y>;
	pinctrl-1 = <&hdpx_pins_sleep_y>;
	status = "disabled";

	muxing-hdp = <(STM32_HDP(x, HDPx_value))>;
};</pre>


=== DT configuration examples ===
The example below shows how to configure and enable HDP instances at board level:

 &hdp {
    pinctrl-names = "default", "sleep";                                    
    pinctrl-0 = <&hdp{{highlight|0}}_pins_a &hdp{{highlight|6}}_pins_a &hdp{{highlight|7}}_pins_a>;                  {{highlight|/* configure pinctrl for hdp pin 0, 6 and 7*/}}
    pinctrl-1 = <&hdp{{highlight|0}}_pins_sleep_a &hdp{{highlight|6}}_pins_sleep_a &hdp{{highlight|7}}_pins_sleep_a>;
    status = "okay";                                                       {{highlight|/* enable HDP */}} 

    muxing-hdp = <(STM32_HDP({{highlight|0}}, {{highlight|HDP0_GPOVAL_0}}) |                           {{highlight|/* For HDP pin 0, the signal HDP0_GPOVAL_0 is selected*/}}
                    STM32_HDP({{highlight|6}}, {{highlight|HDP6_GPOVAL_6}}) |                          {{highlight|/* For HDP pin 6, the signal HDP0_GPOVAL_6 is selected*/}}
                    STM32_HDP({{highlight|7}}, {{highlight|HDP7_GPOVAL_7}}))>;                         {{highlight|/* For HDP pin 7, the signal HDP0_GPOVAL_7 is selected*/}}
 };

List of all possible STM32MP1 [[HDP internal peripheral| HDP ]] signals are located
* for {{MicroprocessorDevice | device=13}}  in  stm32mp13-hdp.h <ref name="stm32mp13-hdp.h">{{CodeSource | Linux kernel | include/dt-bindings/soc/stm32mp13-hdp.h | stm32mp13-hdp.h}}</ref>

* for {{MicroprocessorDevice | device=15}}  in stm32-hdp.h <ref name="stm32-hdp.h">{{CodeSource | Linux kernel | include/dt-bindings/soc/stm32-hdp.h | stm32-hdp.h}}</ref>


== How to configure the DT using STM32CubeMX ==
The [[STM32CubeMX]] tool can be used to configure the STM32MPU device and get the corresponding [[Device_tree#STM32|platform configuration device tree]] files.<br />

The STM32CubeMX may not support all the properties described in the above [[#DT bindings documentation|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.

==References==<references />

<noinclude>

[[Category:Device tree configuration]]
[[Category:Embedded trace and debug]]
{{PublicationRequestId | 10413 | 2019-01-24 | PhilipS}}
{{ArticleBasedOnModel |Peripheral or framework device tree configuration model}}</noinclude>
Line 22: Line 22:
 
* for {{MicroprocessorDevice | device=15}}  in stm32mp151.dtsi <ref name="stm32mp151.dtsi">{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp151.dtsi | stm32mp151.dtsi}}</ref>
 
* for {{MicroprocessorDevice | device=15}}  in stm32mp151.dtsi <ref name="stm32mp151.dtsi">{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp151.dtsi | stm32mp151.dtsi}}</ref>
   
see [[Device tree]] for further explanation.
 
   
 
{{Warning|This device tree part is related to STM32 microprocessors. It must be kept as is, without being modified by the end user.}}
 
{{Warning|This device tree part is related to STM32 microprocessors. It must be kept as is, without being modified by the end user.}}
 
+
see [[Device tree]] for further explanation.
 
For example:  
 
For example: