diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2015-10-15 14:34:14 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-11-12 13:17:31 -0500 |
commit | a5d1e04a532b1fccd9c4f0a1d4ed6410664a9424 (patch) | |
tree | 561fecb1a34ffb3de34b542236184b254adb6610 /include/aboot.h | |
parent | 3c8f98f5fed5c6f03bb185b79191477885748b14 (diff) | |
download | u-boot-imx-a5d1e04a532b1fccd9c4f0a1d4ed6410664a9424.zip u-boot-imx-a5d1e04a532b1fccd9c4f0a1d4ed6410664a9424.tar.gz u-boot-imx-a5d1e04a532b1fccd9c4f0a1d4ed6410664a9424.tar.bz2 |
sparse: Implement storage abstraction
The current sparse image parser relies heavily on the MMC layer, and
doesn't allow any other kind of storage medium to be used.
Rework the parser to support any kind of storage medium, as long as there
is an implementation for it.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/aboot.h')
-rw-r--r-- | include/aboot.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/aboot.h b/include/aboot.h index 18ff07a..a2b0694 100644 --- a/include/aboot.h +++ b/include/aboot.h @@ -9,6 +9,17 @@ #define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1)) +typedef struct sparse_storage { + unsigned int block_sz; + unsigned int start; + unsigned int size; + const char *name; + + int (*write)(struct sparse_storage *storage, void *priv, + unsigned int offset, unsigned int size, + char *data); +} sparse_storage_t; + static inline int is_sparse_image(void *buf) { sparse_header_t *s_header = (sparse_header_t *)buf; @@ -20,6 +31,5 @@ static inline int is_sparse_image(void *buf) return 0; } -int write_sparse_image(block_dev_desc_t *dev_desc, - disk_partition_t *info, const char *part_name, - void *data, unsigned sz); +int store_sparse_image(sparse_storage_t *storage, void *storage_priv, + void *data); |