diff options
author | Stephen Warren <swarren@nvidia.com> | 2014-06-11 16:03:33 -0600 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-08-09 11:16:58 -0400 |
commit | dd64827eb60de9f71b1a1d6aecf488104cdd7b96 (patch) | |
tree | e4d46c84e1d4b118a284261213eb5cc3db9ea4eb /include/dfu.h | |
parent | 3ee9593fce0b58124e667734d7bc8d44b11a7be2 (diff) | |
download | u-boot-imx-dd64827eb60de9f71b1a1d6aecf488104cdd7b96.zip u-boot-imx-dd64827eb60de9f71b1a1d6aecf488104cdd7b96.tar.gz u-boot-imx-dd64827eb60de9f71b1a1d6aecf488104cdd7b96.tar.bz2 |
dfu: defer parsing of device string to IO backend
Devices are not all identified by a single integer. To support
this, defer the parsing of the device string to the IO backed, so that
it can apply the appropriate rules.
SPI devices are specified as controller:chip_select. SPI/SF support will
be added soon.
MMC devices can also be specified as controller[.hwpart][:partition] in
many commands, although we don't support that syntax in DFU.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'include/dfu.h')
-rw-r--r-- | include/dfu.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/include/dfu.h b/include/dfu.h index df72031..21390aa 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -39,6 +39,8 @@ enum dfu_op { }; struct mmc_internal_data { + int dev_num; + /* RAW programming */ unsigned int lba_start; unsigned int lba_size; @@ -87,7 +89,6 @@ struct dfu_entity { char name[DFU_NAME_SIZE]; int alt; void *dev_private; - int dev_num; enum dfu_device_type dev_type; enum dfu_layout layout; @@ -125,7 +126,7 @@ struct dfu_entity { unsigned int inited:1; }; -int dfu_config_entities(char *s, char *interface, int num); +int dfu_config_entities(char *s, char *interface, char *devstr); void dfu_free_entities(void); void dfu_show_entities(void); int dfu_get_alt_number(void); @@ -136,7 +137,7 @@ char *dfu_extract_token(char** e, int *n); void dfu_trigger_reset(void); int dfu_get_alt(char *name); bool dfu_reset(void); -int dfu_init_env_entities(char *interface, int dev); +int dfu_init_env_entities(char *interface, char *devstr); unsigned char *dfu_get_buf(void); unsigned char *dfu_free_buf(void); unsigned long dfu_get_buf_size(void); @@ -146,9 +147,10 @@ int dfu_write(struct dfu_entity *de, void *buf, int size, int blk_seq_num); int dfu_flush(struct dfu_entity *de, void *buf, int size, int blk_seq_num); /* Device specific */ #ifdef CONFIG_DFU_MMC -extern int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s); +extern int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s); #else -static inline int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s) +static inline int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, + char *s) { puts("MMC support not available!\n"); return -1; @@ -156,9 +158,10 @@ static inline int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s) #endif #ifdef CONFIG_DFU_NAND -extern int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s); +extern int dfu_fill_entity_nand(struct dfu_entity *dfu, char *devstr, char *s); #else -static inline int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s) +static inline int dfu_fill_entity_nand(struct dfu_entity *dfu, char *devstr, + char *s) { puts("NAND support not available!\n"); return -1; @@ -166,9 +169,10 @@ static inline int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s) #endif #ifdef CONFIG_DFU_RAM -extern int dfu_fill_entity_ram(struct dfu_entity *dfu, char *s); +extern int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr, char *s); #else -static inline int dfu_fill_entity_ram(struct dfu_entity *dfu, char *s) +static inline int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr, + char *s) { puts("RAM support not available!\n"); return -1; |