Difference between revisions of "How to create your board device tree"

[quality revision] [quality revision]
m
Applicable for STM32MP15x lines


1 Article purpose[edit]

This article is a guideline to create a first gives guidelines for the creation of an initial TF-A device tree for your board with using STM32CubeMX, and compile it its compilation with OpenSTLinux Distribution Package. Thank you for following the three links given previously to be familiar with those elements before digging into We recommend that you follow the three elements linked above to gain familiarity before embarking on the steps below.

Info white.png Information
The strategy developed in this article consists in of starting your board configuration from a virgin STM32MP1 series Series device, chosen via STM32CubeMX MCU selector. Thank you to follow this guideline and avoid starting from When using these guidelines it is preferable to avoid starting with an ST board, because as an incremental approach is less risky and so, preferred herereduces the risk of potential issues.

2 TF-A setup to get enable the serial log on UART and USB boot[edit]

2.1 In STM32CubeMX[edit]

- Create a new project with the MCU selector, selecting the STM32MP1 part number that is mounted on your board.

- In Pinout & Configuration:

  • RCC: enable the HSE clock source according to your board setup. The HSE is needed for by various PLL PLLs (USB, DDR).
  • UARTx: setup set up the serial console. :
    • Assign UARTx to the "Cortex-A7 non-secure" and the "Boot loader" contexts
    • Select the "Asynchronous" mode
    • In the "pinout view", change the RX and TX lines if the STM32CubeMX default choices are do not maching with match your board.
    • Notice that the UARTx instance is gotten obtained from the device tree for the console, but it is hardcoded hard coded to UART4 with TX on GPIOG11 GPIO G11 for the crash console, in plat/st/stm32mp1/stm32mp1_def.h.
  • USB OTG: setup set up the serial boot interface. :
    • Assign USB OTG to the "Cortex-A7 non-secure", the "Boot loader", and "Boot ROM" contexts.
    • Select the "High speed OTG/Dual_Role_Device".

- In Clock configuration:

  • Adjust the HSE frequency, if needed.necessary
  • Check that the UARTx source clock corresponds to your wish needs, or select HSI by default.
  • Configure the USBPHYC clock mux, to get select an input clock for the PLL USBPHY that is , choosing one of the valid values shown in the clock configuration panel.

- GENERATE CODE then:

Info white.png Information
At During this step, you can ignore the "Warning: DDR not configured" because message, as this is dealt with in the purpose of the next chapter in this article
  • Complete "USER CODE BEGIN root" with "chosen" and "aliases" nodes, taking ST boards board values as example examples (like for instance fdts/stm32mp157a-dk1.dts ).

2.2 In the OpenSTLinux Distribution Package[edit]

- - - i.e.
  • for example minicom)
    • The freshly built TF-A should allow
    to
    • a boot in serial mode, and you should
    observe
    • see the message: "Cannot read DDR node in DT" error in the serial console
    : that
    • ; this is
    fine
    • normal at this
    stage 
    • stage!

3 PMIC configuration via I2C[edit]

This part section explains how to configure the I2Cx to which the STPMIC1 is connected, in case if your board is supplied via this PMIC, and is also used also on ST boards. In the case of a discrete power supply, this part has to be adapted , according to your board implementation.

3.1 In STM32CubeMX[edit]

- In Pinout & Configuration:

  • I2Cx: setup set up the control link for the PMIC.
    • Assign I2Cx to the "Cortex-A7 non-secure", the "Cortex-A7 secure" and the "Boot loader" contexts
    • Select "I2C" mode
    • In the "pinout view", change the SCL and SDA lines if STM32CubeMX default choices are do not maching with match your board.

- In Clock configuration:

  • Check that I2Cx source clock corresponds to your wish requirement, or select HSI by default.

- GENERATE CODE then:

  • Complete USER CODE BEGIN i2cx with  with:
    • "i2c-scl-rising-time-ns" and "i2c-scl-falling-time-ns" properties, computed according to your board characteristics.
    • "pmic" node and all its regulators. You can start from the regulators regulator list of one of the ST boards board device tree trees (like such as fdts/stm32mp157astm32mp15xx-dk1dkx.dts dtsi ) and adapt it according to your board implementation.
  • Complete USER CODE BEGIN addons with "pwr" overlay to specify vdd-supply from the PMIC:
&pwr {
    pwr-regulators {
    vdd-supply = <&vdd>;
    };
};

3.2 In OpenSTLinux Distribution Package[edit]

- Replace the initial STM32CubeMX generated files in your own Yocto machine (layers/meta-st/meta-st-stm32mp-addons/mx/<your project>), with the one freshly-updated one.
- Compile TF-A to take those the new files into account.
- Start the board with STM32CubeProgrammer connected via USB OTG and a terminal on UARTx (i.e. for example minicom), using the flashlayout file generated by Yocto in your 'build-openstlinuxweston-stm32mp1-.../tmp-glibc/deploy/images/stm32mp1-.../flashlayout_st-image-weston' folder.

  • The freshly-built TF-A should allow to a boot in serial mode, and the "PMIC version" should now be displayed in the log, in a message still ending with "Cannot read DDR node in DT".

4 DDR configuration with STM32CubeMX DDR Tuning Tool[edit]

4.1 In STM32CubeMX[edit]

- Prerequisite: the DDR tuning tool interacts with the target via U-Boot SPL, that has to which must be run instead of TF-A. If your board is compatible with ST boards (UARTx = UART4, I2Cx = I2C4, PMIC using and HSE digital bypass), then you can directly use the U-Boot SPL binary from a an ST delivery. Otherwise, you need to must build a U-Boot SPL binary with a configuration in line aligned with your board: U-Boot SPL binary generation can be done from your Yocto machine adding the "basic" boot scheme in your machine conf file:

BOOTSCHEME_LABELS = "trusted basic"

- In Pinout & Configuration:

  • DDR: enable "DDR3 / DDR3L" then select the right "Width" and "Density", in line with according to your board

- In Clock configuration:

  • Scroll down to reach the PLL2R area where "DDRC clock" and "DDRPERFM clock" are visible.
  • Set the DDR expected frequency (533 MHz maximum) then press enter to launch the clock resolver.
  • When a solution is found, it is shown upper in the PLL2 area.

- In Tools / DDR Test Suite:

  • Perform the DDR tuning then "Save tuning to configuration"

- GENERATE CODE

4.2 In OpenSTLinux Distribution Package[edit]

- Replace' the STM32CubeMX generated files in your own Yocto machine (layers/meta-st/meta-st-stm32mp-addons/mx/<your project>), with the one freshly-updated one.
- Compile TF-A to take those the new files into account.
- Start the board with STM32CubeProgrammer connected via USB OTG and a terminal on UARTx (i.e. for example minicom).

  • The DDR will is now properly be initialized now then , and TF-A will load loads U-Boot in into DDR and the . The execution should fail just after the "Booting BL32" notice, because states state definitions are missing in the device tree (in the pwr node overlay).


{{ApplicableFor
|MPUs list=STM32MP15x
|MPUs checklist=STM32MP13x, STM32MP15x
}}
{{ReviewsComments|-- [[User:Gerald Baeza|Gerald Baeza]] ([[User talk:Gerald Baeza|talk]]) 11:06, 4 November 2021 (CET)<br />Article interest questionned because hard to maintain for MP15 already... and MP13 would also have to be considered. To be decided with access statistics figures.}}<noinclude>

[[Category:How to customize software]]</noinclude>

==Article purpose==
This article is a guideline to create a first gives guidelines for the creation of an initial [[TF-A overview|TF-A]] device tree for your board withusing [[STM32CubeMX]], and compile itits compilation with [[STM32MP1 Distribution Package|OpenSTLinux Distribution Package]]. Thank you for following the three links given previously to be familiar with those elements before digging intoWe recommend that you follow the three elements linked above to gain familiarity before embarking on the steps below.
{{Info | The strategy developed in this article consists inof starting your board configuration from a virgin STM32MP1 seriesSeries device, chosen via STM32CubeMX '''MCU selector'''. Thank you to follow this guideline and avoid starting from an ST board, because an incremental approach is less risky and so, preferred hereWhen using these guidelines it is preferable to avoid starting with an ST board, as an incremental approach reduces the risk of potential issues.}}

== TF-A setup to getenable the serial log on UART and USB boot ==
=== In STM32CubeMX ===- Create a new project with the '''MCU selector''', selecting the [[STM32MP15_microprocessor#Part_number_codification|STM32MP1 part number]] that is mounted on your board.<br>

- In '''Pinout & Configuration''':
* '''RCC''': enable the HSE clock source according to your board setup. The HSE is needed forby various PLLPLLs (USB, DDR).
* '''UARTx''': setup set up the serial console.:

** Assign UARTx to the "Cortex-A7 non-secure" and the "Boot loader" contexts
** Select the "Asynchronous" mode
** In the "pinout view", change the RX and TX lines if the STM32CubeMX default choices aredo not maching with match your board.
** Notice that the UARTx instance is gottenobtained from the device tree for the console, but it is hardcoded hard coded to UART4 with TX on GPIOG11 GPIO G11 for the crash console, in ''plat/st/stm32mp1/stm32mp1_def.h.''

* '''USB OTG''': setup set up the serial boot interface.:

** Assign USB OTG to the "Cortex-A7 non-secure", the "Boot loader", and "Boot ROM" contexts.

** Select the "High speed OTG/Dual_Role_Device".
- In '''Clock configuration''':
* Adjust the HSE frequency, if needed.necessary

* Check that the UARTx source clock corresponds to your wishneeds, or select HSI by default.

* Configure the USBPHYC clock mux, to getselect an input clock for the PLL USBPHY that is , choosing one of the valid values shown in the clock configuration panel.
- '''GENERATE CODE''' then:
{{Info | AtDuring this step, you can ignore the "Warning: DDR not configured" because message, as this is the purpose ofdealt with in the next chapter in this article}}
* Complete "USER CODE BEGIN root" with "chosen" and "aliases" nodes, taking ST boardsboard values as example (like examples (for instance {{CodeSource | TF-A | fdts/stm32mp157a-dk1.dts}}).{{InternalInfo|Ticket 70719 workaround : remove &usbphyc, &usbphyc_port0 and &usbphyc_port1 nodes}}

=== In OpenSTLinux Distribution Package ===
-

=== In the OpenSTLinux Distribution Package ===
* Follow [[How to create your own machine]] to '''define your own machine''' and '''compile''' it with the device tree generated in the previous paragraph.<br>
-* Select the [[STM32MP15_STM32 MPU ROM_ code_ overview#Boot_device_selection_via_the_boot_pins_and_OTP|serial boot]] on your board<br>
-* '''Start''' the board with [[STM32CubeProgrammer]] connected via USB OTG and a terminal on UARTx (i.e. for example minicom)
** The freshly built TF-A should allow toa boot in serial mode, and you should observe see the message: "Cannot read DDR node in DT" error in the serial console: that; this is finenormal at this stage !

== PMIC configuration via I2C ==
This partsection explains how to configure the I2Cx to which the [[PMIC_hardware_components#STPMIC1|STPMIC1]] is connected, in case if your board is supplied via this PMIC, used and is also used on [[:Category:Getting_started_with_STM32MP1_boards|ST boards]]. In the case of a discrete power supply, this part has to be adapted, according to your board implementation.

=== In STM32CubeMX ===- In '''Pinout & Configuration''':
* '''I2Cx''': setup set up the control link for the PMIC.
** Assign I2Cx to the "Cortex-A7 non-secure", the "Cortex-A7 secure" and the "Boot loader" contexts
** Select  "I2C" mode
** In the "pinout view", change the SCL and SDA lines if STM32CubeMX default choices aredo not maching with match your board.
- In '''Clock configuration''':
* Check that '''I2Cx source clock''' corresponds to your wishrequirement, or select HSI by default.

- '''GENERATE CODE''' then:
* Complete '''USER CODE BEGIN i2cx''' with :
** "i2c-scl-rising-time-ns" and "i2c-scl-falling-time-ns" properties, computed according to your board characteristics.

** "pmic" node and all its regulators. You can start from the regulatorsregulator list of one of the ST boardsboard device tree (like trees (such as {{CodeSource | TF-A | fdts/stm32mp157a-dk1.dtsstm32mp15xx-dkx.dtsi}}) and adapt it according to your board implementation.
* Complete '''USER CODE BEGIN addons''' with "pwr" overlay to specify vdd-supply from the PMIC:
 &pwr {
     pwr-regulators {
     vdd-supply = <&vdd>;
     };
 };{{InternalInfo|Ticket 70719 workaround : remove &usbphyc, &usbphyc_port0 and &usbphyc_port1 nodes}}

=== In OpenSTLinux Distribution Package ===- '''Replace''' the initial STM32CubeMX generated files in your own Yocto machine (layers/meta-st/meta-st-stm32mp-addons/mx/<your project>), with the one freshly updated-updated one.<br>
- '''Compile''' TF-A to take thosethe new files into account.<br>
- '''Start''' the board with [[STM32CubeProgrammer]] connected via USB OTG and a terminal on UARTx (i.e. for example minicom), using the flashlayout file generated by Yocto in your 'build-openstlinuxweston-stm32mp1-.../tmp-glibc/deploy/images/stm32mp1-.../flashlayout_st-image-weston' folder.

* The freshly -built TF-A should allow toa boot in serial mode, and the "PMIC version" should now be displayed in the log, in a message still ending with "Cannot read DDR node in DT".

== DDR configuration with STM32CubeMX DDR Tuning Tool ==
=== In STM32CubeMX ===- '''Prerequisite''': the DDR tuning tool interacts with the target via [[U-Boot_overview#SPL:_FSBL_for_basic_boot|U-Boot SPL]], that has to which must be run instead of TF-A. If your board is compatible with ST boards (UARTx = UART4, I2Cx = I2C4, PMIC using and HSE digital bypass), then you can directly use the U-Boot SPL binary from aan ST delivery. Otherwise, you need to must build a U-Boot SPL binary with a configuration in line aligned with your board: U-Boot SPL binary generation can be done from your Yocto machine adding the "basic" boot scheme in your machine conf file:
 BOOTSCHEME_LABELS = "trusted {{Highlight|basic}}"

- {{ReviewsComments|-- [[User:Gerald Baeza|Gerald Baeza]] ([[User talk:Gerald Baeza|talk]]) 16:17, 22 June 2020 (CEST)<br />The situation above is temporary and the U-Boot SPL generation should become automatic in EcosystemRelease revision 2.1.0}}In '''Pinout & Configuration''':
* '''DDR''': enable "DDR3 / DDR3L" then select the right "Width" and "Density", in line withaccording to your board- In '''Clock configuration''':
* Scroll down to reach the '''PLL2R''' area where "DDRC clock" and "DDRPERFM clock" are visible.
* Set the '''DDR expected frequency''' (533 MHz maximum) then press enter to launch the clock resolver.
* When a solution is found, it is shown upper in the '''PLL2''' area.- In '''Tools / DDR Test Suite''':
* Perform the '''DDR tuning''' then "Save tuning to configuration"- '''GENERATE CODE'''{{InternalInfo|Ticket 70719 workaround : remove &usbphyc, &usbphyc_port0 and &usbphyc_port1 nodes}}

=== In OpenSTLinux Distribution Package ===- '''''Replace''' the STM32CubeMX generated files in your own Yocto machine (layers/meta-st/meta-st-stm32mp-addons/mx/<your project>), with the one freshly updated-updated one.<br>
- '''Compile''' TF-A to take thosethe new files into account.<br>
- '''Start''' the board with [[STM32CubeProgrammer]] connected via USB OTG and a terminal on UARTx (i.e. for example minicom).

* The DDR will is now properly be initialized now then , and TF-A will load loads U-Boot ininto DDR and the . The execution should fail just after the "Booting BL32" notice, because statesstate definitions are missing in the device tree (in the pwr node overlay).


{{PublicationRequestId | 14366| AnneJ| 2019-12-10}}
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  +
{{ApplicableFor
  +
|MPUs list=STM32MP15x
  +
|MPUs checklist=STM32MP13x, STM32MP15x
  +
}}
  +
{{ReviewsComments|-- [[User:Gerald Baeza|Gerald Baeza]] ([[User talk:Gerald Baeza|talk]]) 11:06, 4 November 2021 (CET)<br />Article interest questionned because hard to maintain for MP15 already... and MP13 would also have to be considered. To be decided with access statistics figures.}}
 
<noinclude>
 
<noinclude>
 
[[Category:How to customize software]]
 
[[Category:How to customize software]]
 
</noinclude>
 
</noinclude>
 
 
==Article purpose==
 
==Article purpose==
This article is a guideline to create a first [[TF-A overview|TF-A]] device tree for your board with [[STM32CubeMX]] and compile it with [[STM32MP1 Distribution Package|OpenSTLinux Distribution Package]]. Thank you for following the three links given previously to be familiar with those elements before digging into the steps below.
+
This article gives guidelines for the creation of an initial [[TF-A overview|TF-A]] device tree for your board using [[STM32CubeMX]], and its compilation with [[STM32MP1 Distribution Package|OpenSTLinux Distribution Package]]. We recommend that you follow the three elements linked above to gain familiarity before embarking on the steps below.
{{Info | The strategy developed in this article consists in starting your board configuration from a virgin STM32MP1 series device chosen via STM32CubeMX '''MCU selector'''. Thank you to follow this guideline and avoid starting from an ST board, because an incremental approach is less risky and so, preferred here.}}
+
{{Info | The strategy developed in this article consists of starting your board configuration from a virgin STM32MP1 Series device, chosen via STM32CubeMX '''MCU selector'''. When using these guidelines it is preferable to avoid starting with an ST board, as an incremental approach reduces the risk of potential issues.}}
   
== TF-A setup to get the serial log on UART and USB boot ==
+
== TF-A setup to enable the serial log on UART and USB boot ==
 
=== In STM32CubeMX ===
 
=== In STM32CubeMX ===
- Create a new project with the '''MCU selector''', selecting the [[STM32MP15_microprocessor#Part_number_codification|STM32MP1 part number]] that is mounted on your board.<br>
+
Create a new project with the '''MCU selector''', selecting the [[STM32MP15_microprocessor#Part_number_codification|STM32MP1 part number]] that is mounted on your board.<br>
   
- In '''Pinout & Configuration''':
+
In '''Pinout & Configuration''':
* '''RCC''': enable the HSE clock source according to your board setup. The HSE is needed for various PLL (USB, DDR).
+
* '''RCC''': enable the HSE clock source according to your board setup. The HSE is needed by various PLLs (USB, DDR).
* '''UARTx''': setup the serial console.
+
* '''UARTx''': set up the serial console:
 
** Assign UARTx to the "Cortex-A7 non-secure" and the "Boot loader" contexts
 
** Assign UARTx to the "Cortex-A7 non-secure" and the "Boot loader" contexts
** Select the "Asynchronous" mode
+
** Select "Asynchronous" mode
** In the "pinout view", change the RX and TX lines if STM32CubeMX default choices are not maching with your board.
+
** In the "pinout view", change the RX and TX lines if the STM32CubeMX default choices do not match your board.
** Notice that UARTx instance is gotten from the device tree for the console but it is hardcoded to UART4 with TX on GPIOG11 for the crash console, in plat/st/stm32mp1/stm32mp1_def.h.
+
** Notice that the UARTx instance is obtained from the device tree for the console, but is hard coded to UART4 with TX on GPIO G11 for the crash console, in ''plat/st/stm32mp1/stm32mp1_def.h''
* '''USB OTG''': setup the serial boot interface.
+
* '''USB OTG''': set up the serial boot interface:
** Assign USB OTG to the "Cortex-A7 non-secure", the "Boot loader" and "Boot ROM" contexts.
+
** Assign USB OTG to the "Cortex-A7 non-secure", "Boot loader", and "Boot ROM" contexts
 
** Select the "High speed OTG/Dual_Role_Device".
 
** Select the "High speed OTG/Dual_Role_Device".
   
- In '''Clock configuration''':
+
In '''Clock configuration''':
* Adjust the HSE frequency, if needed.
+
* Adjust the HSE frequency, if necessary
* Check that UARTx source clock corresponds to your wish or select HSI by default.
+
* Check that the UARTx source clock corresponds to your needs, or select HSI by default
* Configure the USBPHYC clock mux, to get an input clock for the PLL USBPHY that is one of the valid values shown in the clock configuration panel.
+
* Configure the USBPHYC clock mux, to select an input clock for the PLL USBPHY, choosing one of the valid values shown in the clock configuration panel.
   
- '''GENERATE CODE''' then:
+
'''GENERATE CODE''' then:
{{Info | At this step, you can ignore the "Warning: DDR not configured" because this is the purpose of the next chapter in this article}}
+
{{Info | During this step, you can ignore the "Warning: DDR not configured" message, as this is dealt with in the next chapter in this article}}
* Complete "USER CODE BEGIN root" with "chosen" and "aliases" nodes, taking ST boards values as example (like {{CodeSource | TF-A | fdts/stm32mp157a-dk1.dts}}).
+
* Complete "USER CODE BEGIN root" with "chosen" and "aliases" nodes, taking ST board values as examples (for instance {{CodeSource | TF-A | fdts/stm32mp157a-dk1.dts}}).
{{InternalInfo|Ticket 70719 workaround : remove &usbphyc, &usbphyc_port0 and &usbphyc_port1 nodes}}
 
   
=== In OpenSTLinux Distribution Package ===
+
=== In the OpenSTLinux Distribution Package ===
- Follow [[How to create your own machine]] to '''define your own machine''' and '''compile''' it with the device tree generated in the previous paragraph.<br>
+
* Follow [[How to create your own machine]] to '''define your own machine''' and '''compile''' it with the device tree generated in the previous paragraph.<br>
- Select the [[STM32MP15_ROM_code_overview#Boot_device_selection_via_the_boot_pins_and_OTP|serial boot]] on your board<br>
+
* Select the [[STM32 MPU ROM code overview#Boot_device_selection_via_the_boot_pins_and_OTP|serial boot]] on your board<br>
- '''Start''' the board with [[STM32CubeProgrammer]] connected via USB OTG and a terminal on UARTx (i.e. minicom)
+
* '''Start''' the board with [[STM32CubeProgrammer]] connected via USB OTG and a terminal on UARTx (for example minicom)
* The freshly built TF-A should allow to boot in serial mode and you should observe "Cannot read DDR node in DT" error in the serial console: that is fine at this stage !
+
** The freshly built TF-A should allow a boot in serial mode, and you should see the message: "Cannot read DDR node in DT" error in the serial console; this is normal at this stage!
   
 
== PMIC configuration via I2C ==
 
== PMIC configuration via I2C ==
This part explains how to configure the I2Cx to which [[PMIC_hardware_components#STPMIC1|STPMIC1]] is connected, in case your board is supplied via this PMIC, used also on [[:Category:Getting_started_with_STM32MP1_boards|ST boards]]. In case of discrete power supply, this part has to be adapted, according to your board implementation.
+
This section explains how to configure the I2Cx to which the [[PMIC_hardware_components#STPMIC1|STPMIC1]] is connected, if your board is supplied via this PMIC, and is also used on [[:Category:Getting_started_with_STM32MP1_boards|ST boards]]. In the case of a discrete power supply, this part has to be adapted according to your board implementation.
   
 
=== In STM32CubeMX ===
 
=== In STM32CubeMX ===
- In '''Pinout & Configuration''':
+
In '''Pinout & Configuration''':
* '''I2Cx''': setup the control link for the PMIC.
+
* '''I2Cx''': set up the control link for the PMIC.
 
** Assign I2Cx to the "Cortex-A7 non-secure", the "Cortex-A7 secure" and the "Boot loader" contexts
 
** Assign I2Cx to the "Cortex-A7 non-secure", the "Cortex-A7 secure" and the "Boot loader" contexts
 
** Select  "I2C" mode
 
** Select  "I2C" mode
** In the "pinout view", change the SCL and SDA lines if STM32CubeMX default choices are not maching with your board.
+
** In the "pinout view", change the SCL and SDA lines if STM32CubeMX default choices do not match your board.
 
 
- In '''Clock configuration''':
 
* Check that '''I2Cx source clock''' corresponds to your wish or select HSI by default.
 
   
- '''GENERATE CODE''' then:
+
In '''Clock configuration''':
* Complete '''USER CODE BEGIN i2cx''' with :
+
* Check that '''I2Cx source clock''' corresponds to your requirement, or select HSI by default.
** "i2c-scl-rising-time-ns" and "i2c-scl-falling-time-ns" properties, computed according to your board characteristics
+
'''GENERATE CODE''' then:
** "pmic" node and all its regulators. You can start from the regulators list of one of the ST boards device tree (like {{CodeSource | TF-A | fdts/stm32mp157a-dk1.dts}}) and adapt according to your board implementation.
+
* Complete '''USER CODE BEGIN i2cx''' with:
  +
** "i2c-scl-rising-time-ns" and "i2c-scl-falling-time-ns" properties, computed according to your board characteristics.
  +
** "pmic" node and all its regulators. You can start from the regulator list of one of the ST board device trees (such as {{CodeSource | TF-A | fdts/stm32mp15xx-dkx.dtsi}}) and adapt it according to your board implementation.
 
* Complete '''USER CODE BEGIN addons''' with "pwr" overlay to specify vdd-supply from the PMIC:
 
* Complete '''USER CODE BEGIN addons''' with "pwr" overlay to specify vdd-supply from the PMIC:
 
  &pwr {
 
  &pwr {
Line 61: Line 63:
 
     };
 
     };
 
  };
 
  };
{{InternalInfo|Ticket 70719 workaround : remove &usbphyc, &usbphyc_port0 and &usbphyc_port1 nodes}}
 
   
 
=== In OpenSTLinux Distribution Package ===
 
=== In OpenSTLinux Distribution Package ===
- '''Replace''' the initial STM32CubeMX generated files in your own Yocto machine (layers/meta-st/meta-st-stm32mp-addons/mx/<your project>), with the one freshly updated.<br>
+
'''Replace''' the initial STM32CubeMX generated files in your own Yocto machine (layers/meta-st/meta-st-stm32mp-addons/mx/<your project>), with the freshly-updated one.<br>
- '''Compile''' TF-A to take those new files into account.<br>
+
'''Compile''' TF-A to take the new files into account.<br>
- '''Start''' the board with [[STM32CubeProgrammer]] connected via USB OTG and a terminal on UARTx (i.e. minicom), using the flashlayout file generated by Yocto in your 'build-openstlinuxweston-stm32mp1-.../tmp-glibc/deploy/images/stm32mp1-.../flashlayout_st-image-weston' folder.
+
'''Start''' the board with [[STM32CubeProgrammer]] connected via USB OTG and a terminal on UARTx (for example minicom), using the flashlayout file generated by Yocto in your 'build-openstlinuxweston-stm32mp1-.../tmp-glibc/deploy/images/stm32mp1-.../flashlayout_st-image-weston' folder.
   
* The freshly built TF-A should allow to boot in serial mode and the "PMIC version" should now be displayed in the log, still ending with "Cannot read DDR node in DT".
+
* The freshly-built TF-A should allow a boot in serial mode, and the "PMIC version" should now be displayed in the log, in a message still ending with "Cannot read DDR node in DT".
   
 
== DDR configuration with STM32CubeMX DDR Tuning Tool ==
 
== DDR configuration with STM32CubeMX DDR Tuning Tool ==
 
=== In STM32CubeMX ===
 
=== In STM32CubeMX ===
- '''Prerequisite''': the DDR tuning tool interacts with the target via [[U-Boot_overview#SPL:_FSBL_for_basic_boot|U-Boot SPL]], that has to be run instead of TF-A. If your board is compatible with ST boards (UARTx = UART4, I2Cx = I2C4, PMIC using and HSE digital bypass), then you can directly use U-Boot SPL binary from a ST delivery. Otherwise, you need to build a U-Boot SPL binary with a configuration in line with your board: U-Boot SPL binary generation can be done from your Yocto machine adding the "basic" boot scheme in your machine conf file:
+
'''Prerequisite''': the DDR tuning tool interacts with the target via [[U-Boot_overview#SPL:_FSBL_for_basic_boot|U-Boot SPL]], which must be run instead of TF-A. If your board is compatible with ST boards (UARTx = UART4, I2Cx = I2C4, PMIC using and HSE digital bypass), you can directly use the U-Boot SPL binary from an ST delivery. Otherwise, must build a U-Boot SPL binary with a configuration aligned with your board: U-Boot SPL binary generation can be done from your Yocto machine adding the "basic" boot scheme in your machine conf file:
 
  BOOTSCHEME_LABELS = "trusted {{Highlight|basic}}"
 
  BOOTSCHEME_LABELS = "trusted {{Highlight|basic}}"
 
+
{{ReviewsComments|-- [[User:Gerald Baeza|Gerald Baeza]] ([[User talk:Gerald Baeza|talk]]) 16:17, 22 June 2020 (CEST)<br />The situation above is temporary and the U-Boot SPL generation should become automatic in EcosystemRelease revision 2.1.0}}
- In '''Pinout & Configuration''':
+
In '''Pinout & Configuration''':
* '''DDR''': enable "DDR3 / DDR3L" then select the right "Width" and "Density", in line with your board
+
* '''DDR''': enable "DDR3 / DDR3L" then select the right "Width" and "Density", in according to your board
- In '''Clock configuration''':
+
In '''Clock configuration''':
 
* Scroll down to reach the '''PLL2R''' area where "DDRC clock" and "DDRPERFM clock" are visible.
 
* Scroll down to reach the '''PLL2R''' area where "DDRC clock" and "DDRPERFM clock" are visible.
 
* Set the '''DDR expected frequency''' (533 MHz maximum) then press enter to launch the clock resolver.
 
* Set the '''DDR expected frequency''' (533 MHz maximum) then press enter to launch the clock resolver.
 
* When a solution is found, it is shown upper in the '''PLL2''' area.
 
* When a solution is found, it is shown upper in the '''PLL2''' area.
- In '''Tools / DDR Test Suite''':
+
In '''Tools / DDR Test Suite''':
 
* Perform the '''DDR tuning''' then "Save tuning to configuration"
 
* Perform the '''DDR tuning''' then "Save tuning to configuration"
- '''GENERATE CODE'''
+
'''GENERATE CODE'''
{{InternalInfo|Ticket 70719 workaround : remove &usbphyc, &usbphyc_port0 and &usbphyc_port1 nodes}}
 
   
 
=== In OpenSTLinux Distribution Package ===
 
=== In OpenSTLinux Distribution Package ===
- '''Replace''' the STM32CubeMX generated files in your own Yocto machine (layers/meta-st/meta-st-stm32mp-addons/mx/<your project>), with the one freshly updated.<br>
+
''Replace''' the STM32CubeMX generated files in your own Yocto machine (layers/meta-st/meta-st-stm32mp-addons/mx/<your project>), with the freshly-updated one.<br>
- '''Compile''' TF-A to take those new files into account.<br>
+
'''Compile''' TF-A to take the new files into account.<br>
- '''Start''' the board with [[STM32CubeProgrammer]] connected via USB OTG and a terminal on UARTx (i.e. minicom)
+
'''Start''' the board with [[STM32CubeProgrammer]] connected via USB OTG and a terminal on UARTx (for example minicom).
* The DDR will properly be initialized now then TF-A will load U-Boot in DDR and the execution should fail just after "Booting BL32" notice, because states definitions are missing in the device tree (in pwr node overlay).
+
* The DDR is now properly initialized, and TF-A loads U-Boot into DDR. The execution should fail just after the "Booting BL32" notice, because state definitions are missing in the device tree (in the pwr node overlay).
  +
 
  +
 
  +
{{PublicationRequestId | 14366| AnneJ| 2019-12-10}}