u-boot/arch/arm/mach-stm32mp
Patrick Delaunay 954bd1a923 stm32mp: add the command stm32prog
Add a specific command stm32prog for STM32MP soc family
witch allows to program the boot devices with the tool
STM32CubeProgrammer (http://www.st.com/STM32CubeProg).

This command uses the same UART STM32 protocol than MCU
STM32 with or USB with DFU protocol v1.1 (ithe MCU ST
extension are no supported).

The executed actions are based on a tab separated value file
with a stm32 header, the FlashLayout file
(https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_flashlayout).

This file is parsed by the U-Boot command to:
- initialize the devices
- create the partition table on each device
- initialize the DFU backend to access to not volatile memory
  (NOR/NAND/SD/eMMC) or to virtual device (OTP/PMIC)

Up to STM32PROG_MAX_DEV (5) devices can be updated with a FlashLayout.

The communication between U-Boot and STM32CubeProgrammer is done with
the specific alternate configuration (see "AN5275: USB DFU/USART protocols
used in STM32MP1 Series bootloaders" for details).

The command stm32prog is executed when a boot from USB is detected
(selected with bootpins) and we can program the boot devices with
a simple command (on Windows or Linux):

PC $>  STM32_Programmer_CLI -c port=usb1 -w flaslayout.tsv

1/ the ROM code loads TF-A in embedded RAM (DFU or uart)
2/ TF-A loads flashlayout file and U-Boot in DDR (DFU or uart)
3/ U-Boot executes the stm32prog command (DFU or uart)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14 09:02:12 +02:00
..
cmd_stm32prog stm32mp: add the command stm32prog 2020-05-14 09:02:12 +02:00
include/mach stm32mp: add the command stm32prog 2020-05-14 09:02:12 +02:00
boot_params.c board: stm32mp1: use FDT address provided by TF-A at boot time 2020-05-14 09:02:12 +02:00
bsec.c configs: stm32mp1: replace STM32MP1_TRUSTED by TFABOOT 2020-04-15 09:08:37 +02:00
cmd_stm32key.c stm32mp1: key: add stm32key command 2019-07-12 11:18:53 +02:00
config.mk stm32mp1: add trusted boot with TF-A 2019-04-12 16:09:13 +02:00
cpu.c stm32mp: add function get_cpu_dev 2020-05-14 09:02:12 +02:00
dram_init.c board: stm32mp1: reserve memory for OP-TEE in device tree 2020-05-14 09:02:12 +02:00
fdt.c stm32mp1: dynamically detect op-tee presence 2020-05-14 09:02:12 +02:00
Kconfig stm32mp: add the command stm32prog 2020-05-14 09:02:12 +02:00
Makefile stm32mp: add the command stm32prog 2020-05-14 09:02:12 +02:00
psci.c stm32mp: psci: set cntfrq register of cpu on 2020-03-24 14:17:38 +01:00
pwr_regulator.c stm32mp1: pwr: use the last binding for pwr 2020-02-13 17:26:22 +01:00
spl.c board: stm32mp1: support boot from spi-nand 2020-05-14 09:02:12 +02:00
syscon.c stm32mp1: pwr: use the last binding for pwr 2020-02-13 17:26:22 +01:00