COMBOPHY device tree configuration

Revision as of 09:26, 24 October 2023 by Registered User (Nathalie Sangouard moved page Combophy device tree configuration to COMBOPHY device tree configuration without leaving a redirect: Consistency with other DT configuration articles)
Applicable for STM32MP25x lines

Renaming.png This page is a candidate for renaming (move).
The requested new name is: COMBOPHY_device_tree_configuration .
The supplied reason is: Consistency with other DT configuration articles .
-- Registered User (-) 10:32, 12 October 2023 (CEST).
Wiki maintainers: remember to update the pages that link this page before renaming (moving) it.

1. Article purpose[edit source]

The purpose of this article is to explain how to configure the COMBOPHY internal peripheral using the device tree mechanism, relying on the bindings documentation, that is the description of the required and optional device-tree properties.

It is used by the COMBOPHY Linux driver [1] which registers the relevant information in the PHY framework.

2. DT bindings documentation[edit source]

The device tree binding documents are stored either in the given applicable components listed in the Linux kernel repository:

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 organization.

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/SoC level)[edit source]

The combophy DT node is declared in:

  • stm32mp251.dtsi[2] on STM32MP25x lines More info.png

It is composed of a set of properties, used to describe the COMBOPHY controller: registers address, clocks, resets, ...

combophy: phy@480c0000 {
       compatible = "st,stm32mp25-combophy";
       reg = <0x480c0000 0x1000>;
       #phy-cells = <1>;
       clocks = <&rcc CK_BUS_USB3PCIEPHY>, <&rcc CK_KER_USB3PCIEPHY>;
       clock-names = "apb-clk", "ker-clk";
       resets = <&rcc USB3PCIEPHY_R>;
       reset-names = "phy-rst";
       st,syscfg = <&syscfg>;
       feature-domains = <&rifsc STM32MP25_RIFSC_COMBOPHY_ID>;
       power-domains = <&CLUSTER_PD>;
       status = "disabled";
};
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. DT configuration (board level)[edit source]

The objective of this chapter is to explain how to enable and configure the "combophy" DT node for a board.

Peripheral configuration should be done in specific board device tree files (board dts file).

3.3. DT configuration examples[edit source]

The apb-clk and ker-clk clocks are mandatory for the PCIe and COMBOPHY internal clocking. But default, the reference clock is provided by the PLL from ker-clk. Enable this configuration by setting status = "okay";

&combophy {
         status = "okay";
};

The example below shows how to enable and configure the COMBOPHY to define and use the external 100Mhz pad source for the reference clock instead of the default internal HSE source:

  • Enable external clock reference by adding "pad-clk" to clock-names property
clocks {
       pad_clk: pad-clk {
             #clock-cells = <0>;
             compatible = "fixed-clock";
             clock-frequency = <100000000>;
     };
};
  • Enable external clock reference by adding "pad-clk" to clock-names property and
  • Enable the the COMBOPHY by setting status = "okay";
&combophy {
       clocks = <&rcc CK_BUS_USB3PCIEPHY>, <&rcc CK_KER_USB3PCIEPHY>, <&pad_clk>;
       clock-names = "apb-clk", "ker-clk", "pad-clk";
       status = "okay";
};

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.
STM32CubeMX may not support all the properties described in DT binding files listed 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]

Refer to the following links for additional information: