Difference between revisions of "STM32MP15 U-Boot"

[quality revision] [unchecked revision]
m

This article briefly describes the STM32MP15x lines More info.png support in U-Boot.

1 STM32MP15x lines More info.png support[edit]

For detailed information, please read the file in the delivered U-Boot code = doc/board/st/stm32mp1/README .rst

Also available in official U-Boot Git.

Code :

Configuration Files:

2 Selecting targets : choose defconfig and Device Tree[edit]

Each The STM32 MPU boot chain is supported by one U-Boot configuration with defconfig

Boot chain defconfig FSBL SSBL TEE support Trusted Boot

= stm32mp15_trusted_defconfig

TF-A U-Boot
u-boot.stm32 - Trusted Boot with OP-TEE stm32mp15_optee_defconfig TF-A U-Boot
u-boot.stm32 yes Basic Boot stm32mp15_basic_defconfig SPL
u-boot-spl.stm32 U-Boot
u-boot.img -
Warning white.png Warning
The basic boot chain is not supported/promoted by STMicroelectronics to make product (see Boot chains overview for details).

Several targets/ boards are supported with the associated device-tree (same name as kernel):

STM32MP157C
Board part number Description Device tree Description
STM32MP157A-EV1 Evaluation board More info green.png stm32mp157a-ev1 MB1262+MB1263
STM32MP157C-EV1 Evaluation board More info green.png stm32mp157c-ev1
STM32MP157C-ED1 Evaluation daughterboard MB1263 stm32mp157c-ed1
STM32MP157D-EV1 Evaluation board More info green.png stm32mp157d-ev1
STM32MP157F-EV1 Evaluation board More info green.png stm32mp157f-ev1
STM32MP157A-DK1 Discovery kit More info green.png stm32mp157a-dk1 MB1272
stm32mp157a-STM32MP157D-DK1 Discovery kit More info green.png stm32mp157d-dk1
STM32MP157C-DK2 Discovery kit More info green.png stm32mp157c-dk2 MB1272+MB1407 stm32mp157c-dk2
STM32MP157F-DK2 Discovery kit More info green.png stm32mp157f-dk2

For information the 'Evaluation' daughter-board only (MB1263 without MB1262) is also supported by stm32mp15*-ed1.dts device tree files.

3 Compilation[edit]

see U-Boot_overview#U-Boot_build

With <mode> = 'basic', 'trusted' or 'optee' the defconfig file: stm32mp15_trusted_defconfig

 
 make stm32mp15_<mode>trusted_defconfig
  make DEVICE_TREE=<device tree name> all

The supported variables are:

  • DEVICE_TREE: select in arch/arm/dts the device tree that is used
  • KBUILD_OUTPUT: change the destination directory for the build
  • EXT_DTB: select external device tree

The ouput file is u-boot.stm32.

4 SPL compilation[edit]

The alternate boot chain with SPL is also supported by "stm32mp15_basic_defconfig" but only for U-Boot_SPL:_DDR_interactive_mode

The resulting U-Boot files are located in your build directory:

    • u-boot-spl.stm32 : FSBL = SPL binary with STM32 image header, loaded by ROM code
    • u-boot.img : SSBL = U-Boot binary with uImage header, loaded by SPL
Warning white.png Warning
This alternate boot chain with SPL is not supported/promoted by STMicroelectronics to make product.

5 Examples[edit]

45.1 STM32MP157C-EV1 Evaluation board More info green.png trusted boot[edit]

 
 make stm32mp15_trusted_defconfig
  make DEVICE_TREE=stm32mp157cstm32mp157f-ev1 all

45.2 STM32MP157C-DK2 Discovery kit More info green.png trusted boot[edit]

Using export to select the device tree

 
 export KBUILD_OUTPUT=../build/stm32mp15_trusted
  export DEVICE_TREE=stm32mp157cstm32mp157f-dk2
  make stm32mp15_trusted_defconfig
  make all

45.3 STM32MP157C-ED1 Evaluation daughterboard basic boot Custom board with external device tree[edit]

 
 export KBUILD_OUTPUT=../build/basic
  make stm32mp15_basictrusted_defconfig
  make DEVICEEXT_TREEDTB=stm32mp157cstm32mp157f-ed1myboard.dtb all

45.4 Trusted boot chain with external device tree SPL for STM32MP157C-EV1 Evaluation board More info green.png[edit]

 
 make stm32mp15_trustedbasic_defconfig
  make EXTDEVICE_DTBTREE=boot/stm32mp157c-myboard.dtbev1 all


This article briefly describes the {{MicroprocessorDevice | device=15}} support in [[U-Boot_overview|U-Boot]].

== {{MicroprocessorDevice | device=15}} support ==

For detailed information, please read the file in the delivered U-Boot code = {{CodeSource | U-Boot | doc/board/st/stm32mp1/README.rst}}

Also available in official U-Boot Git.

Code :
* {{CodeSource | U-Boot | arch/arm/mach-stm32mp}}: arch specific code for {{MicroprocessorDevice | device=Class}}
* {{CodeSource | U-Boot | board/st/common}}: STMicroelectronics common code 
* {{CodeSource | U-Boot | board/st/stm32mp1}}: generic STMicroelectronics board for {{MicroprocessorDevice | device=1}}
* drivers/*/*stm32* : drivers

Configuration Files:
* defconfig file
** {{CodeSource | U-Boot | configs/stm32mp15_basic_defconfig}}
** {{CodeSource | U-Boot | configs/stm32mp15_optee_defconfig}}
** {{CodeSource | U-Boot | configs/stm32mp15_trusted_defconfig}}
* config files
** {{CodeSource | U-Boot | include/configs/stm32mp1.h}}
* Device tree in {{CodeSource | U-Boot | arch/arm/dts }}
** stm32mp157stm32mp15*-<board>.dts : same as kernel
** stm32mp157stm32mp15*-<board>-u-boot.dtsi : addition for u-boot ( <<device tree>>-u-boot.dtsi automatically included in build process)

== Selecting targets : choose defconfig and Device Tree ==
EachThe [[Boot_chains_overview|STM32 MPU boot chain]] is supported by one [[U-Boot_overview#Kbuild|U-Boot configuration with defconfig]] 

{| class="st-table"
|-
! Boot chain  !! defconfig !! FSBL !! SSBL !! TEE support
|-
| [[Boot_chains_overview#STM32MP boot chains|''' Trusted Boot''']] || stm32mp15_trusted_defconfig || TF-A  || '''U-Boot'''<br>[[U-Boot_overview#Output_files|u-boot.stm32]] || -
|-
| [[Boot_chains_overview#STM32MP boot chains|''' Trusted Boot''']] with [[OP-TEE_overview|'''OP-TEE''']] || stm32mp15_optee_defconfig || TF-A  || '''U-Boot'''<br>[[U-Boot_overview#Output_files|u-boot.stm32]] || yes
|-
| [[Boot_chains_overview#STM32MP boot chains|'''Basic Boot''']] || stm32mp15_basic_defconfig || SPL<br>[[U-Boot_overview#Output_files|u-boot-spl.stm32]] || '''U-Boot'''<br>[[U-Boot_overview#Output_files|u-boot.img]] || -
|}

{{Warning | The basic boot chain is not supported/promoted by STMicroelectronics to make product (see [[Boot_chains_overview#Boot_chains_features_set|Boot chains overview]] for details).}} 

Several [[STM32MP15_boards|targets/ boards]] are supported with the associated device-tree (same name as kernel):

{| class="st-table"
|-
! Board part number  !! Description !! Device tree
|-
| '''{{Board | type=157C-EV1}}''' || [[MB1262]]+[[MB1263]] || = {{HighlightParam|stm32mp15_trusted_defconfig}}

Several [[STM32MP15_boards|targets/ boards]] are supported with the associated device-tree (same name as kernel):

{| class="st-table"
|-
! Board part number  !! {{Highlight|Device tree}} !! Description 
|-
| '''{{Board | type=157A-EV1}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157a-ev1.dts|stm32mp157a-ev1}} || rowspan="4" | [[MB1262]]+[[MB1263]]
|-
| '''{{Board | type=157C-EV1}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157c-ev1.dts|stm32mp157c-ev1}}
|-
| '''{{Board | type=157D-EV1}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157d-ev1.dts|stm32mp157d-ev1}}
|-
| '''{{Board | type=157F-EV1}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157cstm32mp157f-ev1.dts|'''stm32mp157cstm32mp157f-ev1'''}}
|-
| STM32MP157C-ED1 Evaluation daughterboard || [[MB1263]] || }}
|-
| '''{{Board | type=157A-DK1}}''' ||  {{CodeSource | U-Boot | arch/arm/dts/stm32mp157c-ed1stm32mp157a-dk1.dts|stm32mp157c-ed1}}
|-
| '''{{Board | type=157A-DK1}}''' || [[MB1272]] || stm32mp157a-dk1}} || rowspan="2" | [[MB1272]]
|-
| '''{{Board | type=157D-DK1}}''' ||  {{CodeSource | U-Boot | arch/arm/dts/stm32mp157astm32mp157d-dk1.dts|'''stm32mp157astm32mp157d-dk1'''}}
|-
| '''{{Board | type=157C-DK2}}''' || [[MB1272]]+[[MB1407]] || {{{{CodeSource | U-Boot | arch/arm/dts/stm32mp157c-dk2.dts|stm32mp157c-dk2}} || rowspan="2" | [[MB1272]]+[[MB1407]] 
|-
| '''{{Board | type=157F-DK2}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157cstm32mp157f-dk2.dts|'''stm32mp157cstm32mp157f-dk2'''}}
|}
For information the 'Evaluation' daughter-board only ([[MB1263]] without [[MB1262]]) is also supported by stm32mp15*-ed1.dts device tree files.
== Compilation ==
see [[U-Boot_overview#U-Boot_build]]

With <mode> = 'basic', 'trusted' or 'optee'

  {{PC$}} make stm32mp15_<mode>_defconfigthe defconfig file: {{HighlightParam|stm32mp15_trusted_defconfig}}

  {{PC$}} make {{HighlightParam|stm32mp15_trusted_defconfig}}

  {{PC$}} make DEVICE_TREE={{HighlightParam|<device tree name>}} all
*The supported variables are:
* '''DEVICE_TREE''': select in arch/arm/dts the device tree that is used
* '''KBUILD_OUTPUT''': change the destination directory for the build
* '''EXT_DTB''': select external device tree
== The ouput file is {{Highlight|'''u-boot.stm32'''}}.

== SPL compilation ==

The alternate boot chain with SPL is also supported by ''"stm32mp15_basic_defconfig"'' but only for [[U-Boot_SPL:_DDR_interactive_mode]]

The resulting U-Boot files are located in your build directory:
** '''u-boot-spl.stm32''' : FSBL = SPL binary with STM32 image header, loaded by ROM code
** '''u-boot.img''' : SSBL = U-Boot binary with uImage header, loaded by SPL

{{Warning | This alternate boot chain with SPL is not supported/promoted by STMicroelectronics to make product.}} 

== Examples ==

=== {{Board | type=157C-EV1}}  trusted boot ===
  {{PC$}} make {{HighlightParam|stm32mp15_trusted_defconfig}}

  {{PC$}} make DEVICE_TREE=stm32mp157c{{HighlightParam|stm32mp157f-ev1}} all

=== {{Board | type=157C-DK2}} trusted boot ===
Using export to select the device tree
  {{PC$}} export KBUILD_OUTPUT=../build/stm32mp15_trusted
  {{PC$}} export DEVICE_TREE=stm32mp157c{{HighlightParam|stm32mp157f-dk2}}

  {{PC$}} make {{HighlightParam|stm32mp15_trusted_defconfig}}

  {{PC$}} make all

=== STM32MP157C-ED1 Evaluation daughterboard basic boot ===
  {{PC$}} export KBUILD_OUTPUT=../build/basic
  {{PC$}} make stm32mp15_basic_defconfig
  {{PC$}} make DEVICE_TREE=stm32mp157c-ed1 all

=== Trusted boot chain with external device tree ===
  {{PC$}} make stm32mp15_trusted_defconfig
  {{PC$}} make EXT_DTB=boot/stm32mp157c-myboard.dtbCustom board with external device tree ===
  {{PC$}} make {{HighlightParam|stm32mp15_trusted_defconfig}}
  {{PC$}} make EXT_DTB={{HighlightParam|stm32mp157f-myboard.dtb}} all

=== SPL for {{Board | type=157C-EV1}} ===
  {{PC$}} make stm32mp15_basic_defconfig
  {{PC$}} make DEVICE_TREE={{HighlightParam|stm32mp157c-ev1}} all
<noinclude>

[[Category:U-Boot]]
{{PublicationRequestId | 12895 | 2019-08-01}}</noinclude>
Line 3: Line 3:
 
== {{MicroprocessorDevice | device=15}} support ==
 
== {{MicroprocessorDevice | device=15}} support ==
   
For detailed information, please read the file in the delivered U-Boot code = {{CodeSource | U-Boot | board/st/stm32mp1/README}}
+
For detailed information, please read the file in the delivered U-Boot code = {{CodeSource | U-Boot | doc/board/st/stm32mp1.rst}}
   
 
Also available in official U-Boot Git.
 
Also available in official U-Boot Git.
Line 9: Line 9:
 
Code :
 
Code :
 
* {{CodeSource | U-Boot | arch/arm/mach-stm32mp}}: arch specific code for {{MicroprocessorDevice | device=Class}}
 
* {{CodeSource | U-Boot | arch/arm/mach-stm32mp}}: arch specific code for {{MicroprocessorDevice | device=Class}}
  +
* {{CodeSource | U-Boot | board/st/common}}: STMicroelectronics common code
 
* {{CodeSource | U-Boot | board/st/stm32mp1}}: generic STMicroelectronics board for {{MicroprocessorDevice | device=1}}
 
* {{CodeSource | U-Boot | board/st/stm32mp1}}: generic STMicroelectronics board for {{MicroprocessorDevice | device=1}}
 
* drivers/*/*stm32* : drivers
 
* drivers/*/*stm32* : drivers
Line 15: Line 16:
 
* defconfig file
 
* defconfig file
 
** {{CodeSource | U-Boot | configs/stm32mp15_basic_defconfig}}
 
** {{CodeSource | U-Boot | configs/stm32mp15_basic_defconfig}}
** {{CodeSource | U-Boot | configs/stm32mp15_optee_defconfig}}
 
 
** {{CodeSource | U-Boot | configs/stm32mp15_trusted_defconfig}}
 
** {{CodeSource | U-Boot | configs/stm32mp15_trusted_defconfig}}
 
* config files
 
* config files
 
** {{CodeSource | U-Boot | include/configs/stm32mp1.h}}
 
** {{CodeSource | U-Boot | include/configs/stm32mp1.h}}
 
* Device tree in {{CodeSource | U-Boot | arch/arm/dts }}
 
* Device tree in {{CodeSource | U-Boot | arch/arm/dts }}
** stm32mp157*-<board>.dts : same as kernel
+
** stm32mp15*-<board>.dts : same as kernel
** stm32mp157*-<board>-u-boot.dtsi : addition for u-boot ( <<device tree>>-u-boot.dtsi automatically included in build process)
+
** stm32mp15*-<board>-u-boot.dtsi : addition for u-boot ( <<device tree>>-u-boot.dtsi automatically included in build process)
   
 
== Selecting targets : choose defconfig and Device Tree ==
 
== Selecting targets : choose defconfig and Device Tree ==
   
Each [[Boot_chains_overview|boot chain]] is supported by one [[U-Boot_overview#Kbuild|U-Boot configuration with defconfig]]
+
The [[Boot_chains_overview|STM32 MPU boot chain]] is supported by one [[U-Boot_overview#Kbuild|U-Boot configuration with defconfig]] = {{HighlightParam|stm32mp15_trusted_defconfig}}
  +
 
  +
Several [[STM32MP15_boards|targets/ boards]] are supported with the associated device-tree (same name as kernel):
   
 
{| class="st-table"
 
{| class="st-table"
 
|-
 
|-
! Boot chain !! defconfig !! FSBL !! SSBL !! TEE support
+
! Board part number !! {{Highlight|Device tree}} !! Description
 
|-
 
|-
| [[Boot_chains_overview#STM32MP boot chains|''' Trusted Boot''']] || stm32mp15_trusted_defconfig || TF-|| '''U-Boot'''<br>[[U-Boot_overview#Output_files|u-boot.stm32]] || -
+
| '''{{Board | type=157A-EV1}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157a-ev1.dts|stm32mp157a-ev1}} || rowspan="4" | [[MB1262]]+[[MB1263]]
 
|-
 
|-
| [[Boot_chains_overview#STM32MP boot chains|''' Trusted Boot''']] with [[OP-TEE_overview|'''OP-TEE''']] || stm32mp15_optee_defconfig || TF-A  || '''U-Boot'''<br>[[U-Boot_overview#Output_files|u-boot.stm32]] || yes
+
| '''{{Board | type=157C-EV1}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157c-ev1.dts|stm32mp157c-ev1}}
 
|-
 
|-
| [[Boot_chains_overview#STM32MP boot chains|'''Basic Boot''']] || stm32mp15_basic_defconfig || SPL<br>[[U-Boot_overview#Output_files|u-boot-spl.stm32]] || '''U-Boot'''<br>[[U-Boot_overview#Output_files|u-boot.img]] || -
+
| '''{{Board | type=157D-EV1}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157d-ev1.dts|stm32mp157d-ev1}}
|}
 
 
 
{{Warning | The basic boot chain is not supported/promoted by STMicroelectronics to make product (see [[Boot_chains_overview#Boot_chains_features_set|Boot chains overview]] for details).}}  
 
 
 
Several [[STM32MP15_boards|targets/ boards]] are supported with the associated device-tree (same name as kernel):
 
 
 
{| class="st-table"
 
 
|-
 
|-
! Board part number  !! Description !! Device tree
+
| '''{{Board | type=157F-EV1}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157f-ev1.dts|stm32mp157f-ev1}}
 
|-
 
|-
| '''{{Board | type=157C-EV1}}''' || [[MB1262]]+[[MB1263]] || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157c-ev1.dts|'''stm32mp157c-ev1'''}}
+
| '''{{Board | type=157A-DK1}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157a-dk1.dts|stm32mp157a-dk1}} || rowspan="2" | [[MB1272]]
 
|-
 
|-
| STM32MP157C-ED1 Evaluation daughterboard || [[MB1263]] || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157c-ed1.dts|stm32mp157c-ed1}}
+
| '''{{Board | type=157D-DK1}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157d-dk1.dts|stm32mp157d-dk1}}
 
|-
 
|-
| '''{{Board | type=157A-DK1}}''' || [[MB1272]] || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157a-dk1.dts|'''stm32mp157a-dk1'''}}
+
| '''{{Board | type=157C-DK2}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157c-dk2.dts|stm32mp157c-dk2}} || rowspan="2" | [[MB1272]]+[[MB1407]]
 
|-
 
|-
| '''{{Board | type=157C-DK2}}''' || [[MB1272]]+[[MB1407]] || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157c-dk2.dts|'''stm32mp157c-dk2'''}}
+
| '''{{Board | type=157F-DK2}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp157f-dk2.dts|'''stm32mp157f-dk2'''}}
 
|}
 
|}
  +
  +
For information the 'Evaluation' daughter-board only ([[MB1263]] without [[MB1262]]) is also supported by stm32mp15*-ed1.dts device tree files.
   
 
== Compilation ==
 
== Compilation ==
 
see [[U-Boot_overview#U-Boot_build]]
 
see [[U-Boot_overview#U-Boot_build]]
   
With <mode> = 'basic', 'trusted' or 'optee'
+
With the defconfig file: {{HighlightParam|stm32mp15_trusted_defconfig}}
   
   {{PC$}} make stm32mp15_<mode>_defconfig
+
   {{PC$}} make {{HighlightParam|stm32mp15_trusted_defconfig}}
   {{PC$}} make DEVICE_TREE=<device tree name> all
+
   {{PC$}} make DEVICE_TREE={{HighlightParam|<device tree name>}} all
   
*'''DEVICE_TREE''': select in arch/arm/dts the device tree that is used
+
The supported variables are:
  +
* '''DEVICE_TREE''': select in arch/arm/dts the device tree that is used
 
* '''KBUILD_OUTPUT''': change the destination directory for the build
 
* '''KBUILD_OUTPUT''': change the destination directory for the build
 
* '''EXT_DTB''': select external device tree
 
* '''EXT_DTB''': select external device tree
  +
  +
The ouput file is {{Highlight|'''u-boot.stm32'''}}.
  +
  +
== SPL compilation ==
  +
  +
The alternate boot chain with SPL is also supported by ''"stm32mp15_basic_defconfig"'' but only for [[U-Boot_SPL:_DDR_interactive_mode]]
  +
  +
The resulting U-Boot files are located in your build directory:
  +
** '''u-boot-spl.stm32''' : FSBL = SPL binary with STM32 image header, loaded by ROM code
  +
** '''u-boot.img''' : SSBL = U-Boot binary with uImage header, loaded by SPL
  +
  +
{{Warning | This alternate boot chain with SPL is not supported/promoted by STMicroelectronics to make product.}}
   
 
== Examples ==
 
== Examples ==
   
=== {{Board | type=157C-EV1}} trusted boot ===
+
=== {{Board | type=157C-EV1}} ===
   {{PC$}} make stm32mp15_trusted_defconfig
+
   {{PC$}} make {{HighlightParam|stm32mp15_trusted_defconfig}}
   {{PC$}} make DEVICE_TREE=stm32mp157c-ev1 all
+
   {{PC$}} make DEVICE_TREE={{HighlightParam|stm32mp157f-ev1}} all
   
=== {{Board | type=157C-DK2}} trusted boot ===
+
=== {{Board | type=157C-DK2}} ===
 
Using export to select the device tree
 
Using export to select the device tree
   {{PC$}} export KBUILD_OUTPUT=../build/trusted
+
   {{PC$}} export KBUILD_OUTPUT=../build/stm32mp15_trusted
   {{PC$}} export DEVICE_TREE=stm32mp157c-dk2
+
   {{PC$}} export DEVICE_TREE={{HighlightParam|stm32mp157f-dk2}}
   {{PC$}} make stm32mp15_trusted_defconfig
+
   {{PC$}} make {{HighlightParam|stm32mp15_trusted_defconfig}}
 
   {{PC$}} make all
 
   {{PC$}} make all
   
=== STM32MP157C-ED1 Evaluation daughterboard basic boot ===
+
=== Custom board with external device tree ===
   {{PC$}} export KBUILD_OUTPUT=../build/basic
+
   {{PC$}} make {{HighlightParam|stm32mp15_trusted_defconfig}}
  +
  {{PC$}} make EXT_DTB={{HighlightParam|stm32mp157f-myboard.dtb}} all
  +
 
  +
=== SPL for {{Board | type=157C-EV1}} ===
 
   {{PC$}} make stm32mp15_basic_defconfig
 
   {{PC$}} make stm32mp15_basic_defconfig
   {{PC$}} make DEVICE_TREE=stm32mp157c-ed1 all
+
   {{PC$}} make DEVICE_TREE={{HighlightParam|stm32mp157c-ev1}} all
 
 
=== Trusted boot chain with external device tree ===
 
  {{PC$}} make stm32mp15_trusted_defconfig
 
  {{PC$}} make EXT_DTB=boot/stm32mp157c-myboard.dtb all
 
   
 
<noinclude>
 
<noinclude>