HDP device tree configuration

Revision as of 14:34, 6 February 2020 by Registered User
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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]
Info white.png Information
Please note that the upstreaming of the HDP Linux driver source code is in progress

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 HDP node is described in the stm32mp157c.dtsi [2] file with disabled status and required properties such as:

  • The physical base address and size of the device register map
  • The HDP clock
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.

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.

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 HDP signals:

/* define HDP Pins number*/
HDP0_PWR_PWRWAKE_SYS
HDP0_CM4_SLEEPDEEP
HDP0_PWR_STDBY_WKUP
HDP0_PWR_ENCOMP_VDDCORE
HDP0_BSEC_OUT_SEC_NIDEN
HDP0_RCC_CM4_SLEEPDEEP
HDP0_GPU_DBG7
HDP0_DDRCTRL_LP_REQ
HDP0_PWR_DDR_RET_ENABLE_N
HDP0_GPOVAL_0

HDP1_PWR_PWRWAKE_MCU
HDP1_CM4_HALTED
HDP1_CA7_NAXIERRIRQ
HDP1_PWR_OKIN_MR
HDP1_BSEC_OUT_SEC_DBGEN
HDP1_EXTI_SYS_WAKEUP
HDP1_RCC_PWRDS_MPU
HDP1_GPU_DBG6
HDP1_DDRCTRL_DFI_CTRLUPD_REQ
HDP1_DDRCTRL_CACTIVE_DDRC_ASR
HDP1_GPOVAL_1

HDP2_PWR_PWRWAKE_MPU
HDP2_CM4_RXEV
HDP2_CA7_NPMUIRQ1
HDP2_CA7_NFIQOUT1
HDP2_BSEC_IN_RSTCORE_N
HDP2_EXTI_C2_WAKEUP
HDP2_RCC_PWRDS_MCU
HDP2_GPU_DBG5
HDP2_DDRCTRL_DFI_INIT_COMPLETE
HDP2_DDRCTRL_PERF_OP_IS_REFRESH
HDP2_DDRCTRL_GSKP_DFI_LP_REQ
HDP2_GPOVAL_2

HDP3_PWR_SEL_VTH_VDD_C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DRCTRL_HPR_CREDIT_CNT
HDP7_GPOVAL_7

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]

  1. <Linux kernel directory>/Documentation/devicetree/bindings/soc/stm32/stm32_hdp.txt
  2. arch/arm/boot/dts/stm32mp157c.dtsi , STM32MP157C device tree file