Koushik Dutta | 16c0ace | 2010-12-13 19:26:03 -0800 | [diff] [blame] | 1 | #ifndef FLASHUTILS_H |
| 2 | #define FLASHUTILS_H |
| 3 | |
Koushik Dutta | 8a6bc77 | 2011-05-26 11:14:15 -0700 | [diff] [blame] | 4 | int restore_raw_partition(const char* partitionType, const char *partition, const char *filename); |
| 5 | int backup_raw_partition(const char* partitionType, const char *partition, const char *filename); |
| 6 | int erase_raw_partition(const char* partitionType, const char *partition); |
Koushik Dutta | 19447c0 | 2010-11-10 10:40:44 -0800 | [diff] [blame] | 7 | int erase_partition(const char *partition, const char *filesystem); |
| 8 | int mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only); |
Steve Kondik | 4123b58 | 2010-11-14 03:18:40 -0500 | [diff] [blame] | 9 | int get_partition_device(const char *partition, char *device); |
| 10 | |
| 11 | #define FLASH_MTD 0 |
| 12 | #define FLASH_MMC 1 |
| 13 | #define FLASH_BML 2 |
| 14 | |
| 15 | int is_mtd_device(); |
| 16 | char* get_default_filesystem(); |
| 17 | |
Steve Kondik | 4123b58 | 2010-11-14 03:18:40 -0500 | [diff] [blame] | 18 | extern int cmd_mtd_restore_raw_partition(const char *partition, const char *filename); |
| 19 | extern int cmd_mtd_backup_raw_partition(const char *partition, const char *filename); |
| 20 | extern int cmd_mtd_erase_raw_partition(const char *partition); |
| 21 | extern int cmd_mtd_erase_partition(const char *partition, const char *filesystem); |
| 22 | extern int cmd_mtd_mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only); |
| 23 | extern int cmd_mtd_get_partition_device(const char *partition, char *device); |
| 24 | |
| 25 | extern int cmd_mmc_restore_raw_partition(const char *partition, const char *filename); |
| 26 | extern int cmd_mmc_backup_raw_partition(const char *partition, const char *filename); |
| 27 | extern int cmd_mmc_erase_raw_partition(const char *partition); |
| 28 | extern int cmd_mmc_erase_partition(const char *partition, const char *filesystem); |
| 29 | extern int cmd_mmc_mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only); |
| 30 | extern int cmd_mmc_get_partition_device(const char *partition, char *device); |
| 31 | |
| 32 | extern int cmd_bml_restore_raw_partition(const char *partition, const char *filename); |
| 33 | extern int cmd_bml_backup_raw_partition(const char *partition, const char *filename); |
| 34 | extern int cmd_bml_erase_raw_partition(const char *partition); |
| 35 | extern int cmd_bml_erase_partition(const char *partition, const char *filesystem); |
| 36 | extern int cmd_bml_mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only); |
| 37 | extern int cmd_bml_get_partition_device(const char *partition, char *device); |
| 38 | |
Koushik Dutta | 16c0ace | 2010-12-13 19:26:03 -0800 | [diff] [blame] | 39 | extern int device_flash_type(); |
Koushik Dutta | 4187347 | 2011-05-26 17:30:43 -0700 | [diff] [blame] | 40 | extern int get_flash_type(const char* fs_type); |
Steve Kondik | 4123b58 | 2010-11-14 03:18:40 -0500 | [diff] [blame] | 41 | |
Koushik Dutta | 16c0ace | 2010-12-13 19:26:03 -0800 | [diff] [blame] | 42 | enum flash_type { |
| 43 | UNSUPPORTED = -1, |
| 44 | UNKNOWN = 0, |
| 45 | MTD = 1, |
| 46 | MMC = 2, |
| 47 | BML = 3 |
| 48 | }; |
| 49 | |
| 50 | #endif |