aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp/cmd_stm32prog
Commit message (Collapse)AuthorAgeFilesLines
* arm: Rename STM32MP15xPatrick Delaunay2024-01-191-2/+2
| | | | | | | | | CONFIG options must not use lower-case letter. Convert this and related ones to upper case. Signed-off-by: Simon Glass <sjg@chromium.org Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* arm: Rename STM32MP13xPatrick Delaunay2024-01-191-1/+1
| | | | | | | | | CONFIG options must not use lower-case letter. Convert this and related ones to upper case. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
* stm32mp: stm32prog: add support of stm32mp25Patrick Delaunay2024-01-191-1/+9
| | | | | | | Change OTP number to 364 for STM32MP25 as it is done in bsec driver. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32: Use bootm_run() and bootz_run()Simon Glass2023-12-211-9/+11
| | | | | | | | Use the new bootm/z_run() functions to avoid having to create an argument list for the stm32prog code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
* stm32: Use local vars in stm32prog for initrd and fdtSimon Glass2023-12-211-9/+14
| | | | | | | | | | | | | Rather than assigning to the bootm_argv[] array multiple times, use local variables for the two things that can change and assign them at the end. This makes it easier to drop the array eventually. Tidu up an overly short line while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
* common: Drop linux/printk.h from common headerSimon Glass2023-09-245-0/+6
| | | | | | | | | This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* stm32mp: stm32prog: use the decimal format by default for offset parsingPatrick Delaunay2023-06-161-1/+1
| | | | | | | | | | | | | | | | | | Change the default base for offset parsing with simple_strtoull(), so offset in flashlayout is coded in base 10 by default, even if string start with '0'. The Octal encoding is not supported. The base 16 is still supported when the '0x' header is detected. This patch solves an unexpected parsing result when the address, provided by decimal value is starting by 0, for example 0x4400 = 00017408 is a invalid with current code. ... P 0x04 fsbl1 Binary mmc0 00017408 tf-a.stm32 .... Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: fix OTP read/write error managementPatrick Delaunay2023-06-161-1/+8
| | | | | | | | | | | | | Avoid to ignore the OTP read/write error and transmits the error to STM32CubeProgrammer. Today the error is only displayed in log error: so the user on HOST thinks the OTP operation is performed. Reported-by: Mickael GARDET <m.gardet@overkiz.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Fixes: 75ea9e75931c ("stm32mp: stm32prog: add TEE support in stm32prog command") Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: Add support of FWU_MDATA partition typePatrick Delaunay2023-06-162-0/+12
| | | | | | | | | | | | | | | | | | | Add support of "FWU_MDATA" partition type in flashlayout to select the TF-A firmware update metadata partition type guid, associated to U-Boot "system" partition type guid, FWU_MDATA_GUID introduced by commit 2eaedc95164f ("FWU: Add FWU metadata structure and driver for accessing metadata") and used in gpt_get_mdata_partitions() for commit 554b38f7a532 ("FWU: Add FWU metadata access driver for GPT partitioned block devices") See also recommendation in FWU-PSA-A_DEN0118_1.0ALP3.pdf 4.1.2 Metadata integration with GPT When embedded in a GPT, each metadata replica occupies a single partition with PartitionTypeGUID = metadata_uuid. UUID = 8a7a84a0-8387-40f6-ab41-a8b9a5a60d23 Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: Add support of ESP partition typePatrick Delaunay2023-06-162-2/+14
| | | | | | | | | | | | Add support of "ESP" partition type in flashlayout to select the "EFI System Partition", associated to U-Boot "system" partition type guid, PARTITION_SYSTEM_GUID = C12A7328-F81F-11d2-BA4B-00A0C93EC93B. This partition is the bootable partition for efi boot. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: Add support of ENV partition typePatrick Delaunay2023-06-162-0/+6
| | | | | | | | | | | | Add support of "ENV" partition type in flashlayout to select the "u-boot-env" GUID, with PARTITION_U_BOOT_ENVIRONMENT = 3de21764-95bd-54bd-a5c3-4abe786f38a8, that mean a partition holding a U-Boot environment introduced by commit c0364ce1c695 ("doc/README.gpt: define partition type GUID for U-Boot environment")' Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: Remove tee_detected from stm32prog_data structPatrice Chotard2023-06-163-23/+0
| | | | | | | | | As stm32prog_get_tee_partitions() is no more used, remove tee_detected boolean from stm32prog_data struct and all code using it. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: Remove usage of "mtdparts" functionPatrice Chotard2023-06-161-23/+19
| | | | | | | | | | | | | | | Motivation for this patch is to remove usage of function define in cmd/mtdparts.c interface, based on env variables mtdids and mtdparts: mtdparts_init() and find_dev_and_part(). See commit 938db6fe5da3 ("cmd: mtdparts: describe as legacy") Now, all MTD devices are populated with their partition's information found in DT, accessible in MTD devices. Use these information to find the wanted partitions, no more need of find_dev_and_part() usage. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* Correct SPL uses of PMIC_STPMIC1Simon Glass2023-02-101-2/+2
| | | | | | | This converts 2 usages of this option to the non-SPL form, since there is no SPL_PMIC_STPMIC1 defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
* Correct SPL uses of MTDSimon Glass2023-02-101-1/+1
| | | | | | | This converts 2 usages of this option to the non-SPL form, since there is no SPL_MTD defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
* Correct SPL use of CMD_BOOTZSimon Glass2023-02-091-1/+1
| | | | | | | This converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_BOOTZ defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Move common image code to image_board and commandSimon Glass2023-01-161-1/+1
| | | | | | | | | | | We should use the cmd/ directory for commands rather than for common code used elsewhere in U-Boot. Move the common 'source' code into image-board.c to achieve this. The image_source_script() function needs to call run_command_list() so seems to belong better in the command library. Move and rename it. Signed-off-by: Simon Glass <sjg@chromium.org>
* cmd: source: Support specifying config nameSean Anderson2022-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | As discussed previously [1,2], the source command is not safe to use with verified boot unless there is a key with required = "images" (which has its own problems). This is because if such a key is absent, signatures are verified but not required. It is assumed that configuration nodes will provide the signature. Because the source command does not use configurations to determine the image to source, effectively no verification takes place. To address this, allow specifying configuration nodes. We use the same syntax as the bootm command (helpfully provided for us by fit_parse_conf). By default, we first try the default config and then the default image. To force using a config, # must be present in the command (e.g. `source $loadaddr#my-conf`). For convenience, the config may be omitted, just like the address may be (e.g. `source \#`). This also works for images (`source :` behaves exactly like `source` currently does). [1] https://lore.kernel.org/u-boot/7d711133-d513-5bcb-52f2-a9dbaa9eeded@prevas.dk/ [2] https://lore.kernel.org/u-boot/042dcb34-f85f-351e-1b0e-513f89005fdd@gmail.com/ Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* treewide: Use NULL for script image nameSean Anderson2022-12-311-1/+1
| | | | | | | | | | | | | | Two callers of image_source_script specify an image name. However, both use the deprecated @ syntax, indicating that they have not been updated in a while. If CONFIG_FIT_SIGNATURE is enabled, we will reject such names outright. Back in commit 152576a598c ("stm32mp: stm32prog: handle U-Boot script in flashlayout alternate"), we even renamed one of the nodes. Instead of hard-coding a script image name, just use the default image. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
* video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEOSimon Glass2022-10-301-1/+1
| | | | | | | Now that all the old code is gone, rename this option. Driver model migration is now complete. Signed-off-by: Simon Glass <sjg@chromium.org>
* stm32mp: stm32prog: improve the partitioning tracePatrick Delaunay2022-09-231-2/+2
| | | | | | | | | Improve the partitioning trace done in command stm32prog: - remove the trace "partition: Done" when the GPT partitioning is not done - indicate the mmc instance used for each 'gpt write' command Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: correctly handle OTP when SMC is not supportedPatrick Delaunay2022-09-232-8/+22
| | | | | | | | | As the SMC is only supported in SP-MIN for STM32MP15x, the associated partition should be absent when the TA NVMEM is not available in OPT-TEE in STM32MP13x. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: solve warning for 64bits compilationPatrick Delaunay2022-09-235-32/+31
| | | | | | | Solve many compilation warning when stm32prog is activated on the aarch64. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: change default flashlayout location to CONFIG_SYS_LOAD_ADDRPatrick Delaunay2022-09-234-7/+7
| | | | | | | | | | | | | Change the defaut flashlayout location, hardcoded at STM32_DDR_BASE, to CONFIG_SYS_LOAD_ADDR to avoid issue on board with reserved memory at STM32_DDR_BASE. This patch changes the command behavior for STM32MP13 and STM32MP15 platform, as CONFIG_SYS_LOAD_ADDR(0xc2000000) != STM32_DDR_BASE but without impact for serial boot with STM32CubeProgrammer. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: support empty flashlayoutPatrick Delaunay2022-09-231-0/+4
| | | | | | | | | | When the STM32CubeProgrammer sent a empty flashlayout.tsv file, the command stm32prog correctly parse the file but data->dev_nb = 0 and the stm32prog_devices_init operations should be skipped. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* cyclic: Use schedule() instead of WATCHDOG_RESET()Stefan Roese2022-09-181-3/+3
| | | | | | | | | | Globally replace all occurances of WATCHDOG_RESET() with schedule(), which handles the HW_WATCHDOG functionality and the cyclic infrastructure. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
* blk: Switch over to using uclass IDsSimon Glass2022-09-161-2/+2
| | | | | | | | | | | | We currently have an if_type (interface type) and a uclass id. These are closely related and we don't need to have both. Drop the if_type values and use the uclass ones instead. Maintain the existing, subtle, one-way conversion between UCLASS_USB and UCLASS_MASS_STORAGE for now, and add a comment. Signed-off-by: Simon Glass <sjg@chromium.org>
* stm32mp: stm32prog: fix the last character of dfu_alt_add third parameterPatrick Delaunay2022-06-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | The third parameter of dfu_alt_add(), the string description of alternate, is build in stm32prog_alt_add() with a unnecessary character ';' at the end of the string. This separator was required in the first implementation of dfu_alt_add() but is no more needed in the current implementation; this separator is managed only in dfu_config_interfaces() which call dfu_alt_add() for this parameter without this separator. And since the commit 53b406369e9d ("DFU: Check the number of arguments and argument string strictly"), this added character cause an error when the stm32prog command is executed because the third parameter of dfu_alt_add() must be a string with a numerical value; 's' must be NULL in the result of call in dfu_fill_entity_mmc(): third_arg = simple_strtoul(argv[2], &s, 0); Fixes: 53b406369e9d ("DFU: Check the number of arguments and argument string strictly") Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: handle flashlayout without STM32 image headerPatrick Delaunay2022-05-101-1/+2
| | | | | | | | | | | | Accept flashlayout without header in alternate 0, to simplify the support of stm32prog command with dfu-util. By default the flashlayout file size is the size of the received binary, provided with the offset in the DFU alternate. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: handle U-Boot script in flashlayout alternatePatrick Delaunay2022-05-103-7/+13
| | | | | | | | | | | | | | | | Update the stm32prog command to allow the reception of U-Boot script in the FlashLayout alternate during the first USB enumeration. This patch is aligned with the last TF-A behavior: the Flashlayout is now loaded by U-Boot; it is no more present at STM32_DDR_BASE when the stm32prog is launched after a serial boot, on UART or on USB. The received script must be a U-Boot legacy image, no more need to add a stm32image header. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: handle interruption during the first enumerationPatrick Delaunay2022-05-101-2/+5
| | | | | | | | | | | | | | When an interruption is received during the first USB enumeration used to received the FlashLayout, with handle ctrl-c, the second enumeration is not needed and the result for stm32prog_usb_loop is false (reset is not needed). This patch avoids the need of a second ctrl to interrupt the command stm32prog. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: add support of UUID for FIP partitionPatrick Delaunay2022-05-102-20/+59
| | | | | | | | | | | | | | | | | | Add support of UUID for FIP parttion, required by Firmware update support in TF-A: - UUID TYPE for FIP partition: 19d5df83-11b0-457b-be2c-7559c13142a5 - "fip-a" partition UUID: 4fd84c93-54ef-463f-a7ef-ae25ff887087 - "fip-b" partition UUID: 09c54952-d5bf-45af-acee-335303766fb3 This check is done with a new partition type "FIP" associated at the FIP UUID. The A/B partition UUID is detected by the partition name: "fip-a", "fip-b". Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: add support of STM32IMAGE version 2Patrick Delaunay2022-05-103-48/+114
| | | | | | | | | Add support of new header for the STM32IMAGE version V2 in command stm32prog command for STM32MP13x family. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: add TEE support in stm32prog commandPatrick Delaunay2022-05-104-14/+142
| | | | | | | | | | | | When OP-TEE is used, the SMC for BSEC management are not available and the PTA provisioning for OTP must be used. U-Boot opens the session to this PTA and use it for OTP access. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: add CONFIG_CMD_STM32PROG_OTPPatrick Delaunay2022-05-102-27/+46
| | | | | | | | | | | | | Add a configuration flag CONFIG_CMD_STM32PROG_OTP to enable the support of OTP update in stm32prog command. This new configuration allows to deactivate this feature for security reason and it is a preliminary step for support of OPT update with the OP-TEE provisioning TA. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: fix commentPatrick Delaunay2022-05-101-1/+1
| | | | | | | | Fix "partition" in comment. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32prog: add partition name in treat_partition_list error messagesPatrick Delaunay2022-01-241-6/+6
| | | | | | | | | | | | | | Add the partition name and remove the line number in error messages of treat_partition_list() to provide correct information to user of STM32CubeProgrammer. The "line number" value was confusing because it is incorrect here; the index in part_array[] is not aligned with the line number in the parsed Layout file, because the empty lines and the lines beginning by '#' are skipped during the first parsing in parse_flash_layout(). Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* doc: replace @return by Return:Heinrich Schuchardt2022-01-191-2/+2
| | | | | | | | | | | | Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* stm32mp: stm32prog: Normalise newlinesWilliam Grant2021-11-101-2/+1
| | | | | | | | | The missing trailing newline could confuse check-config.sh if the definition of an option was on the first line of the next file that find(1) happened to return. Signed-off-by: William Grant <wgrant@ubuntu.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
* stm32mp1: stm32prog: remove stm32prog_get_tee_partitions with FIPPatrick Delaunay2021-08-163-0/+8
| | | | | | | | | | | | | The MTD tee partitions used to save the OP-TEE binary are needed when TF-A doesn't use the FIP container to load binaries. This patch puts under CONFIG_STM32MP15x_STM32IMAGE flag the associated code in U-Boot binary and prepare the code cleanup when CONFIG_STM32MP15x_STM32IMAGE support will be removed after TF-A migration to FIP support. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* global: Convert simple_strtoul() with decimal to dectoul()Simon Glass2021-08-022-2/+2
| | | | | | | It is a pain to have to specify the value 10 in each call. Add a new dectoul() function and update the code to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* global: Convert simple_strtoul() with hex to hextoul()Simon Glass2021-08-021-2/+2
| | | | | | | | | It is a pain to have to specify the value 16 in each call. Add a new hextoul() function and update the code to use it. Add a proper comment to simple_strtoul() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
* stm32mp: stm32prog: use defines for virtual partition sizePatrick Delaunay2021-07-163-4/+5
| | | | | | | | | | | Use the existing defines PMIC_SIZE and OTP_SIZE and a new define CMD_SIZE for virtual partition size. This patch corrects the size for OTP partition in alternate name (1024 instead of 512) and avoids other alignment issues. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: fix the content of short help messagePatrick Delaunay2021-07-161-5/+5
| | | | | | | | | Reduce the content of short help message for stm32prog command and removed the carriage return to fix the display of 'help' command when this command is activated. Fixes: 954bd1a923a6 ("stm32mp: add the command stm32prog") Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
* stm32mp: stm32prog: handle dfu errorPatrick Delaunay2021-06-181-0/+14
| | | | | | | Handle DFU stack error in STM32CubeProgrammer protocol. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: change one message level to debugPatrick Delaunay2021-06-181-1/+1
| | | | | | | | | | | | | Move the message "Invalid or missing layout file." to debug level as it is a normal behavior and not an error and add the missing '\n'. This patch avoids the strange trace : Boot over usb0! Invalid or missing layout file.DFU alt info setting: done Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: use get_cpu_dev for GetID commandPatrick Delaunay2021-06-181-4/+6
| | | | | | | | | | Use get_cpu_dev() in uart getID command and remove the defines DEVICE_ID_BYTE1 and 2 defines. This patch prepare the support for new SOC family. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: correctly handle DM_PMICPatrick Delaunay2021-06-181-1/+4
| | | | | | | | | Correctly handle number of alternate when DM_PMIC is not activated. This patch remove the last UNKNOWN partition in this case. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
* stm32mp: stm32prog: handle the next phase after USB re-enumerationPatrick Delaunay2021-06-181-5/+2
| | | | | | | | | Handle the second USB enumeration only when the flashlayout is received and when phase is PHASE_FLASHLAYOUT. This patch removes the call of stm32prog_next_phase as it is already done in stm32prog_dfu_init(). Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* stm32mp: stm32prog: solve compilation with CONFIG_FIT_SIGNATUREPatrick Delaunay2021-06-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | When CONFIG_FIT_SIGNATURE is activated, CONFIG_LEGACY_IMAGE_FORMAT is deactivated and the define IMAGE_FORMAT_LEGACY don't exist with include/image.h: #if defined(CONFIG_LEGACY_IMAGE_FORMAT) #define IMAGE_FORMAT_LEGACY 0x01 /* legacy image_header based format */ #endif This patch adds the needed check on compilation flag CONFIG_LEGACY_IMAGE_FORMAT to avoid the compilation error for command stm32prog: cmd_stm32prog.c:81:8: error: ‘IMAGE_FORMAT_LEGACY’ undeclared (first use in this function); did you mean ‘IMAGE_FORMAT_FIT’? 81 | if (IMAGE_FORMAT_LEGACY == | ^~~~~~~~~~~~~~~~~~~ | IMAGE_FORMAT_FIT Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>