1. Article purpose[edit | 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 | edit source]
The device tree binding documents are stored in the Linux kernel repository:
- Linux® device tree bindings: Documentation/devicetree/bindings/phy/st,stm32-combophy.yaml
3. DT configuration[edit | 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 | edit source]
The combophy DT node is declared in:
- stm32mp251.dtsi[2] on STM32MP25x lines
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>;
wakeup-source;
interrupts-extended = <&exti1 45 IRQ_TYPE_EDGE_FALLING>;
status = "disabled";
};
3.2. DT configuration (board level)[edit | 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 | edit source]
3.3.1. DT configuration example using internal reference clock generator[edit | edit source]
The apb-clk and ker-clk clocks are mandatory for the COMBOPHY internal clocking, as well as for the USB3DR or the PCIe. By default, the reference clock is provided by the PLL from ker-clk.
- Enable this configuration by setting status = "okay";
&combophy { status = "okay"; };
Information |
In this configuration, when the COMBOPHY is used in PCIe mode, the PLL is used to generate the 100MHz clock reference on the PCIe connector. |
- For the USB3DR case, the st,ssc-on property must be added:
&combophy { st,ssc-on; status = "okay"; };
Information |
In this configuration, when the COMBOPHY is used in USB3 mode, the SSC[3] (Spread Spectrum Clocking) should be enabled. |
3.3.2. DT configuration example using 100 MHz external reference clock for PCIe[edit | edit source]
The example below shows how to enable and configure the COMBOPHY to define and use the external 100 MHz pad source for the reference clock instead of the default internal HSE source:
- Add a "fixed-clock" node, called "pad-clk" into the board device tree file;
clocks {
pad_clk: pad-clk {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <100000000>;
};
};
- Enable this external clock reference by adding:
- &pad_clk to clocks property,
- "pad-clk" to clock-names property.
- Enable 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 | 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 the 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 | edit source]
Refer to the following links for additional information:
- ↑ drivers/phy/st/phy-stm32-combophy.c
- ↑ arch/arm64/boot/dts/st/stm32mp251.dtsi , STM32MP251 device tree file
- ↑ Support of SSC in USB 3.0 Products