summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/mrccache.h
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-10-11 21:37:41 -0700
committerSimon Glass <sjg@chromium.org>2015-10-21 07:46:27 -0600
commit4b9f6a669ee22ac4694a3a339e94e8fe30bfad1f (patch)
tree578229c582254b2dd27d00bc83b7e79eacff9695 /arch/x86/include/asm/mrccache.h
parent42913a1c7ad6efae598364f5ea1ae083279b571f (diff)
downloadu-boot-imx-4b9f6a669ee22ac4694a3a339e94e8fe30bfad1f.zip
u-boot-imx-4b9f6a669ee22ac4694a3a339e94e8fe30bfad1f.tar.gz
u-boot-imx-4b9f6a669ee22ac4694a3a339e94e8fe30bfad1f.tar.bz2
x86: Use struct mrc_region to describe a mrc region
Currently struct fmap_entry is used to describe a mrc region. However this structure contains some other fields that are not related to mrc cache and causes confusion. Besides, it does not include a base address field to store SPI flash's base address. Instead in the mrccache.c it tries to use CONFIG_ROM_SIZE to calculate the SPI flash base address, which unfortunately is not 100% correct as CONFIG_ROM_SIZE may not match the whole SPI flash size. Define a new struct mrc_region and use it instead. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/include/asm/mrccache.h')
-rw-r--r--arch/x86/include/asm/mrccache.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/x86/include/asm/mrccache.h b/arch/x86/include/asm/mrccache.h
index bcf7117..e35b5ed 100644
--- a/arch/x86/include/asm/mrccache.h
+++ b/arch/x86/include/asm/mrccache.h
@@ -22,7 +22,12 @@ struct __packed mrc_data_container {
u8 data[0]; /* Variable size, platform/run time dependent */
};
-struct fmap_entry;
+struct mrc_region {
+ u32 base;
+ u32 offset;
+ u32 length;
+};
+
struct udevice;
/**
@@ -34,7 +39,7 @@ struct udevice;
* @entry: Position and size of MRC cache in SPI flash
* @return pointer to latest record, or NULL if none
*/
-struct mrc_data_container *mrccache_find_current(struct fmap_entry *entry);
+struct mrc_data_container *mrccache_find_current(struct mrc_region *entry);
/**
* mrccache_update() - update the MRC cache with a new record
@@ -48,7 +53,7 @@ struct mrc_data_container *mrccache_find_current(struct fmap_entry *entry);
* @return 0 if updated, -EEXIST if the record is the same as the latest
* record, -EINVAL if the record is not valid, other error if SPI write failed
*/
-int mrccache_update(struct udevice *sf, struct fmap_entry *entry,
+int mrccache_update(struct udevice *sf, struct mrc_region *entry,
struct mrc_data_container *cur);
/**
@@ -87,7 +92,7 @@ int mrccache_reserve(void);
* tree, -EINVAL if MRC region properties format is incorrect, other error
* if SPI flash probe failed.
*/
-int mrccache_get_region(struct udevice **devp, struct fmap_entry *entry);
+int mrccache_get_region(struct udevice **devp, struct mrc_region *entry);
/**
* mrccache_save() - save MRC data to the SPI flash