mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-30 16:35:37 +00:00
fwu: mtd: get MTD partition specific info from driver
Information about FWU images on MTD partitions is now stored with the corresponding driver instead of a global variable. Get this information from the driver. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:
parent
840afae16f
commit
1bef7198cd
1 changed files with 11 additions and 6 deletions
|
@ -15,16 +15,21 @@
|
||||||
|
|
||||||
#include <dm/ofnode.h>
|
#include <dm/ofnode.h>
|
||||||
|
|
||||||
struct fwu_mtd_image_info
|
|
||||||
fwu_mtd_images[CONFIG_FWU_NUM_BANKS * CONFIG_FWU_NUM_IMAGES_PER_BANK];
|
|
||||||
|
|
||||||
static struct fwu_mtd_image_info *mtd_img_by_uuid(const char *uuidbuf)
|
static struct fwu_mtd_image_info *mtd_img_by_uuid(const char *uuidbuf)
|
||||||
{
|
{
|
||||||
int num_images = ARRAY_SIZE(fwu_mtd_images);
|
int num_images;
|
||||||
|
struct fwu_mdata_mtd_priv *mtd_priv = dev_get_priv(fwu_get_dev());
|
||||||
|
struct fwu_mtd_image_info *image_info = mtd_priv->fwu_mtd_images;
|
||||||
|
|
||||||
|
if (!image_info)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
num_images = CONFIG_FWU_NUM_BANKS *
|
||||||
|
CONFIG_FWU_NUM_IMAGES_PER_BANK;
|
||||||
|
|
||||||
for (int i = 0; i < num_images; i++)
|
for (int i = 0; i < num_images; i++)
|
||||||
if (!strcmp(uuidbuf, fwu_mtd_images[i].uuidbuf))
|
if (!strcmp(uuidbuf, image_info[i].uuidbuf))
|
||||||
return &fwu_mtd_images[i];
|
return &image_info[i];
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue