summaryrefslogtreecommitdiff
path: root/drivers/fwu-mdata
AgeCommit message (Collapse)Author
2026-02-13fwu-mdata: Allow multiple metadata storage drivers to be enabledKory Maincent
Change the Kconfig from a "choice" to a conditional block, allowing multiple FWU metadata storage drivers to be selected simultaneously instead of being mutually exclusive. This enables systems with FWU metadata on different storage types (e.g., both GPT-partitioned block devices and MTD devices) to have both drivers compiled in. The board can then select the appropriate driver at runtime based on the devicetree description. The change converts FWU_MDATA to a menuconfig and replaces the "choice/endchoice" block with "if FWU_MDATA/endif", making FWU_MDATA_GPT_BLK default to 'y' for backward compatibility. Signed-off-by: Kory Maincent <[email protected]> Acked-by: Sughosh Ganu <[email protected]> Reviewed-by: Tom Rini <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>
2025-06-02include/mtd.h: Cleanup usageTom Rini
There are only a few things found in <mtd.h> today. Go through and audit the C files which include <mtd.h> and remove it when not required. Then, add it to the files which had either missed it or had an indirect inclusion of it. Signed-off-by: Tom Rini <[email protected]>
2024-05-24Merge patch series "FWU: Add support for FWU metadata version 2"Tom Rini
Sughosh Ganu <[email protected]> says: The following patch series adds support for version 2 of the FWU metadata. The version 2 metadata structure is defined in the latest revision of the FWU specification [1]. The earlier versions of these patches were migrating to a version 2 only support in U-Boot, similar to TF-A. However, based on feedback from ST [2], this series has been updated to support both versions. A platform would still be needed to enable one of the two versions of metadata through a config symbol. TF-A has code which reads the FWU metadata and boots the platform from the active partition. TF-A has decided to migrate the FWU code to a version 2 only support. These changes have been merged in upstream TF-A. These changes have been tested on the ST DK2 board, which uses the GPT based partitioning scheme. Both V1 and V2 metadata versions have been tested on the DK2 board. These changes need to be tested on platforms with MTD partitioned storage devices.
2024-05-24drivers: fwu: mtd: allocate buffer for image info dynamicallySughosh Ganu
The FWU metadata access driver for MTD partitioned devices currently uses a statically allocated array for storing the updatable image information. This array depends on the number of banks and images per bank. With migration of the FWU metadata to version 2, these parameters are now obtained at runtime from the metadata. Make changes to the FWU metadata access driver for MTD devices to allocate memory for the image information dynamically in the driver's probe function, after having obtained the number of banks and images per bank by reading the metadata. Move the image information as part of the driver's private structure, instead of using a global variable. Signed-off-by: Sughosh Ganu <[email protected]> Tested-by: Michal Simek <[email protected]>
2024-05-24drivers: fwu: add the size parameter to the metadata access API'sSughosh Ganu
In version 2 of the metadata structure, the size of the structure cannot be determined statically at build time. The structure is now broken into the top level structure which contains a field indicating the total size of the structure. Add a size parameter to the metadata access API functions to indicate the number of bytes to be accessed. This is then used to either read the entire structure, or only the top level structure. Signed-off-by: Sughosh Ganu <[email protected]> Tested-by: Michal Simek <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-07fwu-mdata: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Acked-by: Jassi Brar <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-06-09FWU: Add FWU metadata access driver for MTD storage regionsMasami Hiramatsu
In the FWU Multi Bank Update feature, the information about the updatable images is stored as part of the metadata, on a separate region. Add a driver for reading from and writing to the metadata when the updatable images and the metadata are stored on a raw MTD region. The code is divided into core under drivers/fwu-mdata/ and some helper functions clubbed together under lib/fwu_updates/ Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
2023-06-09fwu: meta-data: switch to management by common codeJassi Brar
The common code can now read, verify and fix meta-data copies while exposing one consistent structure to users. Only the .read_mdata() and .write_mdata() callbacks of fwu_mdata_ops are needed. Get rid of .get_mdata() .update_mdata() .get_mdata_part_num() .read_mdata_partition() and .write_mdata_partition() and also the corresponding wrapper functions. Signed-off-by: Jassi Brar <[email protected]> Reviewed-by: Etienne Carriere <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Tested-by: Sughosh Ganu <[email protected]>
2023-06-09fwu: gpt: implement read_mdata and write_mdata callbacksJassi Brar
Moving towards using common code for meta-data management, implement the read/write mdata hooks. Signed-off-by: Jassi Brar <[email protected]> Reviewed-by: Etienne Carriere <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Tested-by: Sughosh Ganu <[email protected]>
2023-06-09fwu: move meta-data management in coreJassi Brar
Instead of each i/f having to implement their own meta-data verification and storage, move the logic in common code. This simplifies the i/f code much simpler and compact. Signed-off-by: Jassi Brar <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Tested-by: Sughosh Ganu <[email protected]>
2023-06-09fwu: gpt: use cached meta-data partition numbersJassi Brar
Use cached values and avoid parsing and scanning through partitions everytime for meta-data partitions because they can't change after bootup. Acked-by: Etienne Carriere <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Jassi Brar <[email protected]> Tested-by: Sughosh Ganu <[email protected]>
2022-10-31FWU: Add FWU metadata access driver for GPT partitioned block devicesSughosh Ganu
In the FWU Multi Bank Update feature, the information about the updatable images is stored as part of the metadata, on a separate partition. Add a driver for reading from and writing to the metadata when the updatable images and the metadata are stored on a block device which is formatted with GPT based partition scheme. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2022-10-31FWU: Add FWU metadata structure and driver for accessing metadataSughosh Ganu
In the FWU Multi Bank Update feature, the information about the updatable images is stored as part of the metadata, which is stored on a dedicated partition. Add the metadata structure, and a driver model uclass which provides functions to access the metadata. These are generic API's, and implementations can be added based on parameters like how the metadata partition is accessed and what type of storage device houses the metadata. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>