Last edited one year ago

HDP device tree configuration

Applicable for STM32MP13x lines, STM32MP15x lines

1. Article purpose[edit source]

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 source]

The HDP tree bindings are composed of:

  • STM32 HDP device tree bindings [1]

3. DT configuration[edit source]

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 source]

The STM32MP1 HDP node is located

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

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 source]

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 source]

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 More info.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 source]

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 source]