diff options
| author | Caleb Connolly <[email protected]> | 2024-10-12 15:57:17 +0200 |
|---|---|---|
| committer | Caleb Connolly <[email protected]> | 2024-11-20 17:57:58 +0100 |
| commit | ef14c347db4ae62f964bcf36805563efe1104754 (patch) | |
| tree | bdede09c7a42f0504ba75f99c4a4cc0ca7107474 /include | |
| parent | 0ce0b77243dffc23068c744628f4564d3f396b62 (diff) | |
dfu: add scsi backend
This is extremely similar to the MMC backend, but there are some notable
differences.
Works with a DFU string like
scsi 4=u-boot-bin part 11
Where "4" is the SCSI dev number (sequential LUN across all SCSI devices)
and "11" is the partition number.
Reviewed-by: Mattijs Korpershoek <[email protected]>
Acked-by: Mattijs Korpershoek <[email protected]>
Signed-off-by: Caleb Connolly <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/dfu.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/dfu.h b/include/dfu.h index e25588c33cb..12f9dfcdfcd 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -24,6 +24,7 @@ enum dfu_device_type { DFU_DEV_SF, DFU_DEV_MTD, DFU_DEV_VIRT, + DFU_DEV_SCSI, }; enum dfu_layout { @@ -99,6 +100,19 @@ struct virt_internal_data { int dev_num; }; +struct scsi_internal_data { + int lun; + + /* RAW programming */ + unsigned int lba_start; + unsigned int lba_size; + unsigned int lba_blk_size; + + /* FAT/EXT */ + unsigned int dev; // Always 0??? + unsigned int part; +}; + #if defined(CONFIG_DFU_NAME_MAX_SIZE) #define DFU_NAME_SIZE CONFIG_DFU_NAME_MAX_SIZE #else @@ -126,6 +140,7 @@ struct dfu_entity { struct ram_internal_data ram; struct sf_internal_data sf; struct virt_internal_data virt; + struct scsi_internal_data scsi; } data; int (*get_medium_size)(struct dfu_entity *dfu, u64 *size); @@ -516,6 +531,18 @@ static inline int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr, } #endif +#if CONFIG_IS_ENABLED(DFU_SCSI) +int dfu_fill_entity_scsi(struct dfu_entity *dfu, char *devstr, + char **argv, int argc); +#else +static inline int dfu_fill_entity_scsi(struct dfu_entity *dfu, char *devstr, + char **argv, int argc) +{ + puts("SCSI support not available!\n"); + return -1; +} +#endif + extern bool dfu_reinit_needed; extern bool dfu_alt_info_changed; |
