blob: d112a3180a657ee178994cf81ef50ed7ceb1552d [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001#ifndef FLASHUTILS_H
2#define FLASHUTILS_H
3
4int restore_raw_partition(const char* partitionType, const char *partition, const char *filename);
5int backup_raw_partition(const char* partitionType, const char *partition, const char *filename);
6int erase_raw_partition(const char* partitionType, const char *partition);
7int erase_partition(const char *partition, const char *filesystem);
8int mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only);
9int 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
15int is_mtd_device();
16char* get_default_filesystem();
17
18extern int cmd_mtd_restore_raw_partition(const char *partition, const char *filename);
19extern int cmd_mtd_backup_raw_partition(const char *partition, const char *filename);
20extern int cmd_mtd_erase_raw_partition(const char *partition);
21extern int cmd_mtd_erase_partition(const char *partition, const char *filesystem);
22extern int cmd_mtd_mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only);
23extern int cmd_mtd_get_partition_device(const char *partition, char *device);
24
25extern int cmd_mmc_restore_raw_partition(const char *partition, const char *filename);
26extern int cmd_mmc_backup_raw_partition(const char *partition, const char *filename);
27extern int cmd_mmc_erase_raw_partition(const char *partition);
28extern int cmd_mmc_erase_partition(const char *partition, const char *filesystem);
29extern int cmd_mmc_mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only);
30extern int cmd_mmc_get_partition_device(const char *partition, char *device);
31
32extern int cmd_bml_restore_raw_partition(const char *partition, const char *filename);
33extern int cmd_bml_backup_raw_partition(const char *partition, const char *filename);
34extern int cmd_bml_erase_raw_partition(const char *partition);
35extern int cmd_bml_erase_partition(const char *partition, const char *filesystem);
36extern int cmd_bml_mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only);
37extern int cmd_bml_get_partition_device(const char *partition, char *device);
38
39extern int device_flash_type();
40extern int get_flash_type(const char* fs_type);
41
42enum flash_type {
43 UNSUPPORTED = -1,
44 UNKNOWN = 0,
45 MTD = 1,
46 MMC = 2,
47 BML = 3
48};
49
50#endif