stm32mp: stm32prog: add support of initrd in flashlayout
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Tue, 18 May 2021 13:12:06 +0000 (15:12 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 18 Jun 2021 08:09:41 +0000 (10:09 +0200)
commitd68e53b2798962f7c53a9c11c9bf518b600a03af
treecf127b583c9afa8161d3515e09227e7956296b86
parentd4358a648c5a785e708dbf23f0a67290ac22cf70
stm32mp: stm32prog: add support of initrd in flashlayout

Add the support in command stm32prog of kernel load and start
with initrd file, identify by the partition Type "Binary" in
the flashlayout.tsv, for example:

- 0x01 fsbl Binary none 0x0 tfa.stm32
- 0x03 fip Binary none 0x0 fip.bin
P 0x10 kernel System ram0 0xC2000000 uImage.bin
P 0x11 dtb FileSystem ram0 0xC4000000 board.dtb
P 0x12 initrd Binary ram0 0xC4400000 <initrd>

The <initrd> file can be a legacy image "uInitrd", generated
with mkimage, or a RAW initrd image "initrd.gz".

After a DFU detach the bootm command with be executed
with the associated address, for example:

$> bootm 0xC2000000 0xC4400000:<size> 0xC4000000

When the "Binary" partition type is absent, the 'bootm'
command starts the kernel without ramdisk, for example:

$> bootm 0xC2000000 - 0xC4000000

With this paths, it is no more mandatory to generate FIT
including the kernel, DT and initrd:

- 0x01 fsbl Binary none 0x0 tfa.stm32
- 0x03 fip Binary none 0x0 fip.bin
P 0x10 fit System ram0 0xC2000000 fit.bin

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h