Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 1 | #ifndef FLASHUTILS_H |
| 2 | #define FLASHUTILS_H |
| 3 | |
| 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); |
| 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); |
| 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 | |
| 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 | |
| 39 | extern int device_flash_type(); |
| 40 | extern int get_flash_type(const char* fs_type); |
| 41 | |
| 42 | enum flash_type { |
| 43 | UNSUPPORTED = -1, |
| 44 | UNKNOWN = 0, |
| 45 | MTD = 1, |
| 46 | MMC = 2, |
| 47 | BML = 3 |
| 48 | }; |
| 49 | |
| 50 | #endif |