summaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2021-05-18 15:12:06 +0200
committerPatrice Chotard <patrice.chotard@foss.st.com>2021-06-18 10:09:41 +0200
commitd68e53b2798962f7c53a9c11c9bf518b600a03af (patch)
treecf127b583c9afa8161d3515e09227e7956296b86 /arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
parentd4358a648c5a785e708dbf23f0a67290ac22cf70 (diff)
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>
Diffstat (limited to 'arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c')
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
index 84b880261a..ea69d5dd16 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
@@ -1473,7 +1473,7 @@ error:
return ret;
}
-static void stm32prog_end_phase(struct stm32prog_data *data)
+static void stm32prog_end_phase(struct stm32prog_data *data, u64 offset)
{
if (data->phase == PHASE_FLASHLAYOUT) {
if (parse_flash_layout(data, STM32_DDR_BASE, 0))
@@ -1489,6 +1489,10 @@ static void stm32prog_end_phase(struct stm32prog_data *data)
data->uimage = data->cur_part->addr;
if (data->cur_part->part_type == PART_FILESYSTEM)
data->dtb = data->cur_part->addr;
+ if (data->cur_part->part_type == PART_BINARY) {
+ data->initrd = data->cur_part->addr;
+ data->initrd_size = offset;
+ }
}
if (CONFIG_IS_ENABLED(MMC) &&
@@ -1747,7 +1751,7 @@ void dfu_flush_callback(struct dfu_entity *dfu)
if (dfu->dev_type == DFU_DEV_RAM) {
if (dfu->alt == 0 &&
stm32prog_data->phase == PHASE_FLASHLAYOUT) {
- stm32prog_end_phase(stm32prog_data);
+ stm32prog_end_phase(stm32prog_data, dfu->offset);
/* waiting DFU DETACH for reenumeration */
}
}
@@ -1756,7 +1760,7 @@ void dfu_flush_callback(struct dfu_entity *dfu)
return;
if (dfu->alt == stm32prog_data->cur_part->alt_id) {
- stm32prog_end_phase(stm32prog_data);
+ stm32prog_end_phase(stm32prog_data, dfu->offset);
stm32prog_next_phase(stm32prog_data);
}
}